diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e557fbc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM python:3.10.7-bullseye + +WORKDIR /usr/src/app + +COPY .env ./ +COPY requirements.txt ./ + +RUN python -m pip install -r requirements.txt + +COPY . . + +RUN python manage.py migrate +CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] \ No newline at end of file diff --git a/README.md b/README.md index 7346c38..1c0a392 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,9 @@ GUI in your browser to draw your cloud infrastructure and generate your terrafor ### Test - Rum `python manage.py test` + +### Run with Docker +- Run `docker build -t tfmaker-api .` +- Run `docker run -p 8000:8000 -it --rm --name tfmaker-api tfmaker-api` +- Run `docker exec -it tfmaker-api sh` +- Run in container `python manage.py createsuperuser` diff --git a/requirements.txt b/requirements.txt index d53ece5..4f34073 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,5 @@ mysqlclient~=2.1.1 Pillow~=9.2.0 requests~=2.28.1 django-jsonform~=2.11.1 -django-cors-headers~=3.13.0 \ No newline at end of file +django-cors-headers~=3.13.0 +django-flat-json-widget~=0.2.0 \ No newline at end of file diff --git a/tfmaker/settings.py b/tfmaker/settings.py index ef5de02..ed34580 100644 --- a/tfmaker/settings.py +++ b/tfmaker/settings.py @@ -44,6 +44,7 @@ 'corsheaders', 'django_jsonform', + 'flat_json_widget', 'account', 'api',