From b8c652e78a54a672c5ae894866eb24db795250fe Mon Sep 17 00:00:00 2001 From: viveksantayana Date: Sun, 5 Dec 2021 00:17:54 +0000 Subject: [PATCH] dockerise --- docker-compose.yml | 43 ++++++++++++++++++++++++++++++++++++++- ref-test/.dockerignore | 2 ++ ref-test/Dockerfile | 8 ++++---- ref-test/requirements.txt | 23 +++++++++++++++++++++ src/html/robots.txt | 0 5 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 ref-test/.dockerignore create mode 100644 ref-test/requirements.txt create mode 100644 src/html/robots.txt diff --git a/docker-compose.yml b/docker-compose.yml index c81efd0..6471f10 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,12 +1,45 @@ version: '3.9' services: + # ref_test_server: + # container_name: ref_test_server + # image: nginx:1.21.4-alpine + # volumes: + # - ./certbot:/etc/letsencrypt:ro + # - ./nginx:/etc/nginx + # - ./src/html:/usr/share/nginx/html + # - ./ref-test/admin/static:/usr/share/nginx/html/admin/static + # - ./ref-test/quiz/static:/usr/share/nginx/html/quiz/static + # ports: + # - 80:80 + # - 443:443 + # restart: unless-stopped + # networks: + # - frontend + # depends_on: + # - ref_test_app + + # ref_test_app: + # container_name: ref_test_app + # build: ./ref-test + # env_file: + # - ./.env + # ports: + # - 5000:5000 + # restart: unless-stopped + # networks: + # - frontend + # - backend + # depends_on: + # - ref_test_db + # - ref_test_postfix + ref_test_db: container_name: ref_test_db image: mongo:5.0.4-focal restart: unless-stopped volumes: - # - ./database/data:/data # Uncomment later when persistence is required. + - ./database/data:/data - ./database/initdb.d/:/docker-entrypoint-initdb.d/ env_file: - ./.env @@ -26,6 +59,14 @@ services: networks: - backend + # ref_test_certbot: + # container_name: ref_test_certbot + # image: certbot/certbot:v1.21.0 + # volumes: + # - ./certbot:/etc/letsencrypt + # - + + networks: frontend: external: false diff --git a/ref-test/.dockerignore b/ref-test/.dockerignore new file mode 100644 index 0000000..757ecb3 --- /dev/null +++ b/ref-test/.dockerignore @@ -0,0 +1,2 @@ +env/ +__pycache__/ \ No newline at end of file diff --git a/ref-test/Dockerfile b/ref-test/Dockerfile index 14dfbac..dd67898 100644 --- a/ref-test/Dockerfile +++ b/ref-test/Dockerfile @@ -1,5 +1,5 @@ -FROM python:3.10-alpine -WORKDIR /app +FROM python:3.10-slim +WORKDIR /ref-test COPY . . -RUN pip install -r requirements.txt -CMD [ "gunicorn", "-b", "0.0.0.0:5000", "app:app" ] \ No newline at end of file +RUN pip install --upgrade pip && pip install -r requirements.txt +CMD [ "gunicorn", "-b", "0.0.0.0:5000", "-w", "8", "main:app" ] \ No newline at end of file diff --git a/ref-test/requirements.txt b/ref-test/requirements.txt new file mode 100644 index 0000000..63270f5 --- /dev/null +++ b/ref-test/requirements.txt @@ -0,0 +1,23 @@ +blinker==1.4 +cffi==1.15.0 +click==8.0.3 +cryptography==36.0.0 +dnspython==2.1.0 +dominate==2.6.0 +email-validator==1.1.3 +Flask==2.0.2 +Flask-Bootstrap==3.3.7.1 +Flask-Mail==0.9.1 +Flask-WTF==1.0.0 +gunicorn==20.1.0 +idna==3.3 +itsdangerous==2.0.1 +Jinja2==3.0.3 +MarkupSafe==2.0.1 +pip-autoremove==0.10.0 +pycparser==2.21 +pymongo==4.0 +python-dotenv==0.19.2 +visitor==0.1.3 +Werkzeug==2.0.2 +WTForms==3.0.0 diff --git a/src/html/robots.txt b/src/html/robots.txt new file mode 100644 index 0000000..e69de29