2024-03-21 18:20:50 +00:00
|
|
|
version: "2.2"
|
|
|
|
|
|
|
|
services:
|
|
|
|
app:
|
|
|
|
image: xf/drugs:prod
|
|
|
|
container_name: drugs
|
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
args:
|
|
|
|
OPERATION: ${OPERATION}
|
|
|
|
volumes:
|
|
|
|
- ${REPO_DIR}:/code
|
|
|
|
- ${REPO_DIR}/docker/uwsgi.ini:/conf/uwsgi.ini
|
|
|
|
- ${APP_DATABASE_FILE}:/conf/db.sqlite3
|
|
|
|
- app_static:${STATIC_ROOT}
|
|
|
|
#ports:
|
|
|
|
# - "8000:8000" # uwsgi socket
|
2024-03-21 18:42:21 +00:00
|
|
|
# I don't like this any more than you do
|
|
|
|
environment:
|
|
|
|
APP_PORT: "${APP_PORT}"
|
|
|
|
REPO_DIR: "${REPO_DIR}"
|
|
|
|
STACK_FILE: "${STACK_FILE}"
|
|
|
|
APP_DATABASE_FILE: "${APP_DATABASE_FILE}"
|
|
|
|
DOMAIN: "${DOMAIN}"
|
|
|
|
URL: "${URL}"
|
|
|
|
ALLOWED_HOSTS: "${ALLOWED_HOSTS}"
|
|
|
|
NOTIFY_TOPIC: "${NOTIFY_TOPIC}"
|
|
|
|
CSRF_TRUSTED_ORIGINS: "${CSRF_TRUSTED_ORIGINS}"
|
|
|
|
DEBUG: "${DEBUG}"
|
|
|
|
SECRET_KEY: "${SECRET_KEY}"
|
|
|
|
STATIC_ROOT: "${STATIC_ROOT}"
|
|
|
|
REGISTRATION_OPEN: "${REGISTRATION_OPEN}"
|
|
|
|
OPERATION: "${OPERATION}"
|
|
|
|
PROFILER: "${PROFILER}"
|
|
|
|
BILLING_ENABLED: "${BILLING_ENABLED}"
|
|
|
|
DRUGBANK_USERNAME: "${DRUGBANK_USERNAME}"
|
2024-03-21 18:20:50 +00:00
|
|
|
# volumes_from:
|
|
|
|
# - tmp
|
|
|
|
depends_on:
|
|
|
|
# redis:
|
|
|
|
# condition: service_healthy
|
|
|
|
migration:
|
|
|
|
condition: service_started
|
|
|
|
collectstatic:
|
|
|
|
condition: service_started
|
|
|
|
networks:
|
|
|
|
- default
|
|
|
|
- xf
|
|
|
|
|
|
|
|
migration:
|
|
|
|
image: xf/drugs:prod
|
|
|
|
container_name: migration_drugs
|
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
args:
|
|
|
|
OPERATION: ${OPERATION}
|
|
|
|
command: sh -c '. /venv/bin/activate && python manage.py migrate --noinput'
|
|
|
|
volumes:
|
|
|
|
- ${REPO_DIR}:/code
|
|
|
|
- ${REPO_DIR}/docker/uwsgi.ini:/conf/uwsgi.ini
|
|
|
|
- ${APP_DATABASE_FILE}:/conf/db.sqlite3
|
|
|
|
- app_static:${STATIC_ROOT}
|
|
|
|
# volumes_from:
|
|
|
|
# - tmp
|
2024-03-21 18:42:21 +00:00
|
|
|
environment:
|
|
|
|
APP_PORT: "${APP_PORT}"
|
|
|
|
REPO_DIR: "${REPO_DIR}"
|
|
|
|
STACK_FILE: "${STACK_FILE}"
|
|
|
|
APP_DATABASE_FILE: "${APP_DATABASE_FILE}"
|
|
|
|
DOMAIN: "${DOMAIN}"
|
|
|
|
URL: "${URL}"
|
|
|
|
ALLOWED_HOSTS: "${ALLOWED_HOSTS}"
|
|
|
|
NOTIFY_TOPIC: "${NOTIFY_TOPIC}"
|
|
|
|
CSRF_TRUSTED_ORIGINS: "${CSRF_TRUSTED_ORIGINS}"
|
|
|
|
DEBUG: "${DEBUG}"
|
|
|
|
SECRET_KEY: "${SECRET_KEY}"
|
|
|
|
STATIC_ROOT: "${STATIC_ROOT}"
|
|
|
|
REGISTRATION_OPEN: "${REGISTRATION_OPEN}"
|
|
|
|
OPERATION: "${OPERATION}"
|
|
|
|
PROFILER: "${PROFILER}"
|
|
|
|
BILLING_ENABLED: "${BILLING_ENABLED}"
|
|
|
|
DRUGBANK_USERNAME: "${DRUGBANK_USERNAME}"
|
2024-03-21 18:20:50 +00:00
|
|
|
|
|
|
|
collectstatic:
|
|
|
|
image: xf/drugs:prod
|
|
|
|
container_name: collectstatic_drugs
|
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
args:
|
|
|
|
OPERATION: ${OPERATION}
|
|
|
|
command: sh -c '. /venv/bin/activate && python manage.py collectstatic --noinput'
|
|
|
|
volumes:
|
|
|
|
- ${REPO_DIR}:/code
|
|
|
|
- ${APP_DATABASE_FILE}:/conf/db.sqlite3
|
|
|
|
- app_static:${STATIC_ROOT}
|
|
|
|
# volumes_from:
|
|
|
|
# - tmp
|
2024-03-21 18:42:21 +00:00
|
|
|
environment:
|
|
|
|
APP_PORT: "${APP_PORT}"
|
|
|
|
REPO_DIR: "${REPO_DIR}"
|
|
|
|
STACK_FILE: "${STACK_FILE}"
|
|
|
|
APP_DATABASE_FILE: "${APP_DATABASE_FILE}"
|
|
|
|
DOMAIN: "${DOMAIN}"
|
|
|
|
URL: "${URL}"
|
|
|
|
ALLOWED_HOSTS: "${ALLOWED_HOSTS}"
|
|
|
|
NOTIFY_TOPIC: "${NOTIFY_TOPIC}"
|
|
|
|
CSRF_TRUSTED_ORIGINS: "${CSRF_TRUSTED_ORIGINS}"
|
|
|
|
DEBUG: "${DEBUG}"
|
|
|
|
SECRET_KEY: "${SECRET_KEY}"
|
|
|
|
STATIC_ROOT: "${STATIC_ROOT}"
|
|
|
|
REGISTRATION_OPEN: "${REGISTRATION_OPEN}"
|
|
|
|
OPERATION: "${OPERATION}"
|
|
|
|
PROFILER: "${PROFILER}"
|
|
|
|
BILLING_ENABLED: "${BILLING_ENABLED}"
|
|
|
|
DRUGBANK_USERNAME: "${DRUGBANK_USERNAME}"
|
2024-03-21 18:20:50 +00:00
|
|
|
|
|
|
|
nginx:
|
|
|
|
image: nginx:latest
|
|
|
|
container_name: nginx_drugs
|
|
|
|
ports:
|
|
|
|
- ${APP_PORT}:9999
|
|
|
|
ulimits:
|
|
|
|
nproc: 65535
|
|
|
|
nofile:
|
|
|
|
soft: 65535
|
|
|
|
hard: 65535
|
|
|
|
volumes:
|
|
|
|
- ${REPO_DIR}:/code
|
|
|
|
- ${REPO_DIR}/docker/nginx/conf.d/${OPERATION}.conf:/etc/nginx/conf.d/default.conf
|
|
|
|
- app_static:${STATIC_ROOT}
|
|
|
|
# volumes_from:
|
|
|
|
# - tmp
|
|
|
|
networks:
|
|
|
|
- default
|
|
|
|
- xf
|
|
|
|
depends_on:
|
|
|
|
app:
|
|
|
|
condition: service_started
|
|
|
|
|
|
|
|
# tmp:
|
|
|
|
# image: busybox
|
|
|
|
# container_name: tmp_drugs
|
|
|
|
# command: chmod -R 777 /var/run/socks
|
|
|
|
# volumes:
|
|
|
|
# - /var/run/socks
|
|
|
|
|
|
|
|
# redis:
|
|
|
|
# image: redis
|
|
|
|
# command: redis-server /etc/redis.conf
|
|
|
|
# ulimits:
|
|
|
|
# nproc: 65535
|
|
|
|
# nofile:
|
|
|
|
# soft: 65535
|
|
|
|
# hard: 65535
|
|
|
|
# volumes:
|
|
|
|
# - ${REPO_DIR}/docker/redis.conf:/etc/redis.conf
|
|
|
|
# - redis_data:/data
|
|
|
|
# volumes_from:
|
|
|
|
# - tmp
|
|
|
|
# healthcheck:
|
|
|
|
# test: "redis-cli -s /var/run/socks/redis.sock ping"
|
|
|
|
# interval: 2s
|
|
|
|
# timeout: 2s
|
|
|
|
# retries: 15
|
|
|
|
|
|
|
|
networks:
|
|
|
|
default:
|
|
|
|
driver: bridge
|
|
|
|
xf:
|
|
|
|
external: true
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
app_static: {}
|
|
|
|
# redis_data: {}
|