From ba53064ce275209d1399988aaaf4e4b3799f49bb Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 19 Oct 2021 22:41:18 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A5=20Dockerize=20everything!=20(#74?= =?UTF-8?q?=20closes=20#59)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ✨ Create Dockerfile for the backend * 🔧 Limit the allowed slug values * ✨ Create docker image for the proxy * ✨ Add serve script (and serve dependency) * ✨ Add .dockerignore symlinks to .gitignore * ✨ Create docker image for the frontend * 🔧 Proxy the frontend * 🔧 Configure the proxy.dbm directory * 🚧 WIP * 💥 Improve settings handling * 💥 Prepare backend for docker deployment * 🔧 Reserve `static` notebook slug * ✨ Make static work * 🐛 Set a default value for reduce * 💥 Things * 💥 Everything works! --- .../Start_sophon_backend.xml | 10 +- backend/.dockerignore | 1 + backend/Dockerfile | 36 ++ backend/docker_start.sh | 6 + backend/poetry.lock | 115 ++-- backend/pyproject.toml | 3 +- backend/sophon/core/management/__init__.py | 0 .../core/management/commands/__init__.py | 0 .../core/management/commands/initsuperuser.py | 25 + backend/sophon/notebooks/__init__.py | 7 - backend/sophon/notebooks/admin.py | 3 +- backend/sophon/notebooks/apache.conf | 20 - backend/sophon/notebooks/apache.py | 37 +- backend/sophon/notebooks/docker.py | 30 +- .../migrations/0009_alter_notebook_slug.py | 22 + .../migrations/0010_auto_20211019_1738.py | 30 + .../migrations/0011_auto_20211019_1745.py | 29 + .../0012_alter_notebook_internal_url.py | 19 + backend/sophon/notebooks/models.py | 116 ++-- backend/sophon/notebooks/validators.py | 16 + backend/sophon/settings.py | 492 ++++++++++----- docker-compose.yml | 98 +++ frontend/.dockerignore | 1 + frontend/Dockerfile | 19 + frontend/Frontend (React).iml | 1 + frontend/package.json | 4 +- .../components/elements/DescriptionBox.tsx | 16 +- .../src/components/group/GroupCreateBox.tsx | 2 +- .../instance/InstanceDescriptionBox.tsx | 4 - frontend/src/contexts/cache.tsx | 2 +- frontend/src/types/SophonTypes.ts | 5 +- frontend/yarn.lock | 275 +++++++- proxy/Dockerfile | 4 + proxy/httpd.conf | 595 ++++++++++++++++++ 34 files changed, 1731 insertions(+), 312 deletions(-) create mode 120000 backend/.dockerignore create mode 100644 backend/Dockerfile create mode 100644 backend/docker_start.sh create mode 100644 backend/sophon/core/management/__init__.py create mode 100644 backend/sophon/core/management/commands/__init__.py create mode 100644 backend/sophon/core/management/commands/initsuperuser.py delete mode 100644 backend/sophon/notebooks/apache.conf create mode 100644 backend/sophon/notebooks/migrations/0009_alter_notebook_slug.py create mode 100644 backend/sophon/notebooks/migrations/0010_auto_20211019_1738.py create mode 100644 backend/sophon/notebooks/migrations/0011_auto_20211019_1745.py create mode 100644 backend/sophon/notebooks/migrations/0012_alter_notebook_internal_url.py create mode 100644 backend/sophon/notebooks/validators.py create mode 100644 docker-compose.yml create mode 120000 frontend/.dockerignore create mode 100644 frontend/Dockerfile create mode 100644 proxy/Dockerfile create mode 100644 proxy/httpd.conf diff --git a/.idea/runConfigurations/Start_sophon_backend.xml b/.idea/runConfigurations/Start_sophon_backend.xml index 92070dc..886edf4 100644 --- a/.idea/runConfigurations/Start_sophon_backend.xml +++ b/.idea/runConfigurations/Start_sophon_backend.xml @@ -6,14 +6,14 @@ - + - - - + + + -