You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

126 lines
2.7 KiB
YAML

version: "2.2"
services:
app:
image: xf/envelope:prod
container_name: envelope
build:
context: .
args:
OPERATION: ${OPERATION}
volumes:
- ${PORTAINER_GIT_DIR}:/code
- ${PORTAINER_GIT_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
volumes_from:
- tmp
depends_on:
# redis:
# condition: service_healthy
migration:
condition: service_started
collectstatic:
condition: service_started
networks:
- default
- xf
migration:
image: xf/envelope:prod
container_name: migration_envelope
build:
context: .
args:
OPERATION: ${OPERATION}
command: sh -c '. /venv/bin/activate && python manage.py migrate --noinput'
volumes:
- ${PORTAINER_GIT_DIR}:/code
- ${APP_DATABASE_FILE}:/conf/db.sqlite3
- app_static:${STATIC_ROOT}
env_file:
- stack.env
collectstatic:
image: xf/envelope:prod
container_name: collectstatic_envelope
build:
context: .
args:
OPERATION: ${OPERATION}
command: sh -c '. /venv/bin/activate && python manage.py collectstatic --noinput'
volumes:
- ${PORTAINER_GIT_DIR}:/code
- ${APP_DATABASE_FILE}:/conf/db.sqlite3
- app_static:${STATIC_ROOT}
env_file:
- stack.env
nginx:
image: nginx:latest
container_name: nginx_envelope
ports:
- ${APP_PORT}:9999
ulimits:
nproc: 65535
nofile:
soft: 65535
hard: 65535
volumes:
- ${PORTAINER_GIT_DIR}:/code
- ${PORTAINER_GIT_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
# volumes_from:
# - tmp
# depends_on:
# redis:
# condition: service_healthy
tmp:
image: busybox
container_name: tmp_envelope
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:
# - ${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
networks:
default:
driver: bridge
xf:
external: true
volumes:
app_static: {}