envelope/docker/docker-compose.prod.yml

105 lines
2.4 KiB
YAML
Raw Normal View History

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
build: ${PORTAINER_GIT_DIR}/docker/prod
2022-10-12 06:22:22 +00:00
volumes:
- ${PORTAINER_GIT_DIR}:/code
2022-10-12 06:22:22 +00:00
# - ${PORTAINER_GIT_DIR}/docker/prod/uwsgi.ini:/conf/uwsgi.ini
2022-10-12 06:22:22 +00:00
- ${APP_LOCAL_SETTINGS}:/code/app/local_settings.py
- ${APP_DATABASE_FILE}:/code/db.sqlite3
ports:
2022-10-12 06:22:22 +00:00
- "8000:8000" # uwsgi socket
2022-10-12 06:22:22 +00:00
env_file:
- ../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-12 06:22:22 +00:00
migration:
2022-10-12 06:22:22 +00:00
image: xf/envelope:prod
2022-10-12 06:22:22 +00:00
build: ./docker/prod
command: sh -c '. /venv/bin/activate && python manage.py migrate --noinput'
volumes:
- ${PORTAINER_GIT_DIR}:/code
- ${APP_LOCAL_SETTINGS}:/code/app/local_settings.py
- ${APP_DATABASE_FILE}:/code/db.sqlite3
2022-10-12 06:22:22 +00:00
env_file:
- ../stack.env
collectstatic:
image: xf/envelope:prod
build: ./docker/prod
command: sh -c '. /venv/bin/activate && python manage.py collectstatic --noinput'
volumes:
- ${PORTAINER_GIT_DIR}:/code
- ${APP_LOCAL_SETTINGS}:/code/app/local_settings.py
- ${APP_DATABASE_FILE}:/code/db.sqlite3
env_file:
- ../stack.env
nginx:
image: nginx:latest
ports:
- ${APP_PORT}:9999
ulimits:
nproc: 65535
nofile:
soft: 65535
hard: 65535
volumes:
- ${PORTAINER_GIT_DIR}:/code
- ${PORTAINER_GIT_DIR}/docker/nginx/conf.d:/etc/nginx/conf.d
volumes_from:
- tmp
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
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:
default:
external:
2022-10-12 06:22:22 +00:00
name: xf
# volumes:
# redis_data: {}