2023-10-17 20:00:25 +00:00
|
|
|
version: "2.2"
|
|
|
|
|
|
|
|
services:
|
|
|
|
app:
|
2024-01-01 18:21:27 +00:00
|
|
|
image: xf/drugs:prod
|
|
|
|
container_name: drugs
|
2023-10-17 20:00:25 +00:00
|
|
|
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
|
|
|
|
env_file:
|
|
|
|
- stack.env
|
2024-03-21 15:01:01 +00:00
|
|
|
# volumes_from:
|
|
|
|
# - tmp
|
2023-10-17 20:00:25 +00:00
|
|
|
depends_on:
|
2024-03-21 15:01:01 +00:00
|
|
|
# redis:
|
|
|
|
# condition: service_healthy
|
2023-10-17 20:00:25 +00:00
|
|
|
migration:
|
|
|
|
condition: service_started
|
|
|
|
collectstatic:
|
|
|
|
condition: service_started
|
|
|
|
networks:
|
|
|
|
- default
|
|
|
|
- xf
|
|
|
|
|
|
|
|
migration:
|
2024-01-01 18:21:27 +00:00
|
|
|
image: xf/drugs:prod
|
|
|
|
container_name: migration_drugs
|
2023-10-17 20:00:25 +00:00
|
|
|
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}
|
2024-03-21 15:01:01 +00:00
|
|
|
# volumes_from:
|
|
|
|
# - tmp
|
2023-10-17 20:00:25 +00:00
|
|
|
env_file:
|
|
|
|
- stack.env
|
|
|
|
|
|
|
|
collectstatic:
|
2024-01-01 18:21:27 +00:00
|
|
|
image: xf/drugs:prod
|
|
|
|
container_name: collectstatic_drugs
|
2023-10-17 20:00:25 +00:00
|
|
|
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}
|
2024-03-21 15:01:01 +00:00
|
|
|
# volumes_from:
|
|
|
|
# - tmp
|
2023-10-17 20:00:25 +00:00
|
|
|
env_file:
|
|
|
|
- stack.env
|
|
|
|
|
|
|
|
nginx:
|
|
|
|
image: nginx:latest
|
2024-01-01 18:21:27 +00:00
|
|
|
container_name: nginx_drugs
|
2023-10-17 20:00:25 +00:00
|
|
|
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}
|
2024-03-21 15:01:01 +00:00
|
|
|
# volumes_from:
|
|
|
|
# - tmp
|
2023-10-17 20:00:25 +00:00
|
|
|
networks:
|
|
|
|
- default
|
|
|
|
- xf
|
|
|
|
depends_on:
|
|
|
|
app:
|
|
|
|
condition: service_started
|
|
|
|
|
2024-03-21 15:01:01 +00:00
|
|
|
# tmp:
|
|
|
|
# image: busybox
|
|
|
|
# container_name: tmp_drugs
|
|
|
|
# command: chmod -R 777 /var/run/socks
|
|
|
|
# volumes:
|
|
|
|
# - /var/run/socks
|
2023-10-17 20:00:25 +00:00
|
|
|
|
2024-03-21 15:01:01 +00:00
|
|
|
# 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
|
2023-10-17 20:00:25 +00:00
|
|
|
|
|
|
|
networks:
|
|
|
|
default:
|
|
|
|
driver: bridge
|
|
|
|
xf:
|
|
|
|
external: true
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
app_static: {}
|
2024-03-21 15:01:01 +00:00
|
|
|
# redis_data: {}
|