dockerise

This commit is contained in:
Vivek Santayana 2021-12-05 00:17:54 +00:00
parent cd98763937
commit e7da288904
5 changed files with 71 additions and 5 deletions

View File

@ -1,12 +1,45 @@
version: '3.9' version: '3.9'
services: 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: ref_test_db:
container_name: ref_test_db container_name: ref_test_db
image: mongo:5.0.4-focal image: mongo:5.0.4-focal
restart: unless-stopped restart: unless-stopped
volumes: volumes:
# - ./database/data:/data # Uncomment later when persistence is required. - ./database/data:/data
- ./database/initdb.d/:/docker-entrypoint-initdb.d/ - ./database/initdb.d/:/docker-entrypoint-initdb.d/
env_file: env_file:
- ./.env - ./.env
@ -26,6 +59,14 @@ services:
networks: networks:
- backend - backend
# ref_test_certbot:
# container_name: ref_test_certbot
# image: certbot/certbot:v1.21.0
# volumes:
# - ./certbot:/etc/letsencrypt
# -
networks: networks:
frontend: frontend:
external: false external: false

2
ref-test/.dockerignore Normal file
View File

@ -0,0 +1,2 @@
env/
__pycache__/

View File

@ -1,5 +1,5 @@
FROM python:3.10-alpine FROM python:3.10-slim
WORKDIR /app WORKDIR /ref-test
COPY . . COPY . .
RUN pip install -r requirements.txt RUN pip install --upgrade pip && pip install -r requirements.txt
CMD [ "gunicorn", "-b", "0.0.0.0:5000", "app:app" ] CMD [ "gunicorn", "-b", "0.0.0.0:5000", "-w", "8", "main:app" ]

23
ref-test/requirements.txt Normal file
View File

@ -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

0
src/html/robots.txt Normal file
View File