2022-10-12 06:22:22 +00:00
|
|
|
version: "2.2"
|
2022-10-12 06:22:22 +00:00
|
|
|
|
|
|
|
services:
|
|
|
|
app:
|
2022-10-12 06:22:22 +00:00
|
|
|
image: xf/envelope:prod
|
2022-11-10 07:20:14 +00:00
|
|
|
container_name: envelope
|
2022-10-18 06:22:22 +00:00
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
args:
|
|
|
|
OPERATION: ${OPERATION}
|
2022-10-12 06:22:22 +00:00
|
|
|
volumes:
|
|
|
|
- ${PORTAINER_GIT_DIR}:/code
|
2022-10-18 06:22:22 +00:00
|
|
|
- ${PORTAINER_GIT_DIR}/docker/uwsgi.ini:/conf/uwsgi.ini
|
2022-11-10 07:20:14 +00:00
|
|
|
- ${APP_DATABASE_FILE}:/conf/db.sqlite3
|
|
|
|
- app_static:${STATIC_ROOT}
|
2022-10-13 17:20:30 +00:00
|
|
|
#ports:
|
|
|
|
# - "8000:8000" # uwsgi socket
|
2022-10-12 06:22:22 +00:00
|
|
|
env_file:
|
2022-11-10 07:20:14 +00:00
|
|
|
- stack.env
|
2022-10-12 06:22:22 +00:00
|
|
|
volumes_from:
|
|
|
|
- tmp
|
2022-10-12 06:22:22 +00:00
|
|
|
depends_on:
|
2022-10-12 06:22:22 +00:00
|
|
|
# redis:
|
|
|
|
# condition: service_healthy
|
2022-10-12 06:22:22 +00:00
|
|
|
migration:
|
|
|
|
condition: service_started
|
2022-10-12 06:22:22 +00:00
|
|
|
collectstatic:
|
|
|
|
condition: service_started
|
2022-10-18 06:22:22 +00:00
|
|
|
networks:
|
|
|
|
- default
|
|
|
|
- xf
|
2022-10-12 06:22:22 +00:00
|
|
|
|
|
|
|
migration:
|
2022-10-12 06:22:22 +00:00
|
|
|
image: xf/envelope:prod
|
2022-11-10 07:20:14 +00:00
|
|
|
container_name: migration_envelope
|
2022-10-18 06:22:22 +00:00
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
args:
|
|
|
|
OPERATION: ${OPERATION}
|
2022-10-12 06:22:22 +00:00
|
|
|
command: sh -c '. /venv/bin/activate && python manage.py migrate --noinput'
|
|
|
|
volumes:
|
|
|
|
- ${PORTAINER_GIT_DIR}:/code
|
2022-11-10 07:20:14 +00:00
|
|
|
- ${APP_DATABASE_FILE}:/conf/db.sqlite3
|
|
|
|
- app_static:${STATIC_ROOT}
|
2022-10-12 06:22:22 +00:00
|
|
|
env_file:
|
2022-11-10 07:20:14 +00:00
|
|
|
- stack.env
|
2022-10-12 06:22:22 +00:00
|
|
|
|
|
|
|
collectstatic:
|
|
|
|
image: xf/envelope:prod
|
2022-11-10 07:20:14 +00:00
|
|
|
container_name: collectstatic_envelope
|
2022-10-18 06:22:22 +00:00
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
args:
|
|
|
|
OPERATION: ${OPERATION}
|
2022-10-12 06:22:22 +00:00
|
|
|
command: sh -c '. /venv/bin/activate && python manage.py collectstatic --noinput'
|
|
|
|
volumes:
|
|
|
|
- ${PORTAINER_GIT_DIR}:/code
|
2022-11-10 07:20:14 +00:00
|
|
|
- ${APP_DATABASE_FILE}:/conf/db.sqlite3
|
|
|
|
- app_static:${STATIC_ROOT}
|
2022-10-12 06:22:22 +00:00
|
|
|
env_file:
|
2022-11-10 07:20:14 +00:00
|
|
|
- stack.env
|
2022-10-12 06:22:22 +00:00
|
|
|
|
|
|
|
nginx:
|
|
|
|
image: nginx:latest
|
2022-11-10 07:20:14 +00:00
|
|
|
container_name: nginx_envelope
|
2022-10-12 06:22:22 +00:00
|
|
|
ports:
|
|
|
|
- ${APP_PORT}:9999
|
|
|
|
ulimits:
|
|
|
|
nproc: 65535
|
|
|
|
nofile:
|
|
|
|
soft: 65535
|
|
|
|
hard: 65535
|
|
|
|
volumes:
|
|
|
|
- ${PORTAINER_GIT_DIR}:/code
|
2022-10-18 06:22:22 +00:00
|
|
|
- ${PORTAINER_GIT_DIR}/docker/nginx/conf.d/${OPERATION}.conf:/etc/nginx/conf.d/default.conf
|
2022-11-10 07:20:14 +00:00
|
|
|
- app_static:${STATIC_ROOT}
|
2022-10-12 06:22:22 +00:00
|
|
|
volumes_from:
|
|
|
|
- tmp
|
2022-10-18 06:22:22 +00:00
|
|
|
networks:
|
|
|
|
- default
|
|
|
|
- xf
|
2022-10-12 06:22:22 +00:00
|
|
|
depends_on:
|
|
|
|
app:
|
|
|
|
condition: service_started
|
|
|
|
|
2022-10-12 06:22:22 +00:00
|
|
|
# volumes_from:
|
|
|
|
# - tmp
|
|
|
|
# depends_on:
|
|
|
|
# redis:
|
|
|
|
# condition: service_healthy
|
2022-10-12 06:22:22 +00:00
|
|
|
|
2022-10-12 06:22:22 +00:00
|
|
|
tmp:
|
|
|
|
image: busybox
|
2022-11-10 07:20:14 +00:00
|
|
|
container_name: tmp_envelope
|
2022-10-12 06:22:22 +00:00
|
|
|
command: chmod -R 777 /var/run/socks
|
|
|
|
volumes:
|
|
|
|
- /var/run/socks
|
2022-10-12 06:22:22 +00:00
|
|
|
|
2022-10-12 06:22:22 +00:00
|
|
|
# redis:
|
|
|
|
# image: redis
|
|
|
|
# command: redis-server /etc/redis.conf
|
|
|
|
# ulimits:
|
|
|
|
# nproc: 65535
|
|
|
|
# nofile:
|
|
|
|
# soft: 65535
|
|
|
|
# hard: 65535
|
|
|
|
# volumes:
|
|
|
|
# - ${PORTAINER_GIT_DIR}/docker/redis.conf:/etc/redis.conf
|
|
|
|
# - redis_data:/data
|
|
|
|
# volumes_from:
|
|
|
|
# - tmp
|
|
|
|
# healthcheck:
|
|
|
|
# test: "redis-cli -s /var/run/redis/redis.sock ping"
|
|
|
|
# interval: 2s
|
|
|
|
# timeout: 2s
|
|
|
|
# retries: 15
|
2022-10-12 06:22:22 +00:00
|
|
|
|
|
|
|
networks:
|
2022-10-18 06:22:22 +00:00
|
|
|
default:
|
|
|
|
driver: bridge
|
|
|
|
xf:
|
|
|
|
external: true
|
2022-10-12 06:22:22 +00:00
|
|
|
|
2022-11-10 07:20:14 +00:00
|
|
|
volumes:
|
|
|
|
app_static: {}
|