start prod docker migration
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
redis:
|
||||
image: redis:7.4.2-alpine
|
||||
restart: always
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
healthcheck:
|
||||
test: ["CMD","redis-cli","ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
web:
|
||||
build:
|
||||
# build context is the repository root (one level up from this file)
|
||||
context: ..
|
||||
dockerfile: rad/Dockerfile.prod
|
||||
restart: always
|
||||
env_file:
|
||||
- ../.env.prod
|
||||
environment:
|
||||
- DJANGO_SETTINGS_MODULE=rad.settings.production
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
volumes:
|
||||
- static_volume:/usr/src/app/static
|
||||
- media_volume:/usr/src/app/media
|
||||
# Mount the server-specific local settings if present (DO NOT commit secrets).
|
||||
# On the server create: rad/deploy/settings_local.py and it will be mounted into the container.
|
||||
- ../deploy/settings_local.py:/usr/src/app/rad/settings_local.py:ro
|
||||
expose:
|
||||
- "8000"
|
||||
command: ["/usr/src/app/entrypoint.sh"]
|
||||
|
||||
nginx:
|
||||
image: nginx:stable-alpine
|
||||
restart: always
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
depends_on:
|
||||
- web
|
||||
volumes:
|
||||
- ../deploy/nginx/prod.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
- static_volume:/usr/src/app/static:ro
|
||||
- media_volume:/usr/src/app/media:ro
|
||||
- ../deploy/nginx/certs:/etc/letsencrypt:ro
|
||||
# Host-provided front-end bundles and static folders. Populate these under rad/deploy on the server
|
||||
- ../deploy/www/viewer:/srv/www/viewer:ro
|
||||
- ../deploy/www/ohif:/srv/www/ohif:ro
|
||||
- ../deploy/www/rts:/srv/www/rts:ro
|
||||
- ../deploy/nicereporter:/srv/nicereporter:rw
|
||||
- ../deploy/proc-rota:/srv/proc/rota:ro
|
||||
- ../deploy/uploader:/srv/uploader:ro
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL","nginx -t" ]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
redis_data:
|
||||
static_volume:
|
||||
media_volume:
|
||||
|
||||
networks:
|
||||
default:
|
||||
driver: bridge
|
||||
@@ -0,0 +1,26 @@
|
||||
version: "3.8"
|
||||
|
||||
# Local test compose overlay — adds a Postgres service so you can run the
|
||||
# full stack locally without an external DB. Use it together with
|
||||
# docker-compose.prod.yml:
|
||||
#
|
||||
# docker compose -f rad/docker/docker-compose.prod.yml -f rad/docker/docker-compose.test.yml up -d --build
|
||||
|
||||
services:
|
||||
db:
|
||||
image: postgres:14-alpine
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER:-django}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
||||
POSTGRES_DB: ${POSTGRES_DB:-rad}
|
||||
volumes:
|
||||
- postgres_test_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL","pg_isready -U ${POSTGRES_USER:-django}" ]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
volumes:
|
||||
postgres_test_data:
|
||||
Reference in New Issue
Block a user