django_template/docker-compose.prod.yml

60 lines
1.4 KiB
YAML

version: "3.8"
services:
# To use an built-in Postgres server, uncomment this service
#db:
# # Use regular Postgres by default
# image: postgres:15.3-bullseye
# # Use PostGIS for spatial apps
# #image: postgis/postgis:15-3.3
# env_file: .env
# volumes:
# - db_data:/var/lib/postgresql/data
# healthcheck:
# test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
# interval: 10s
# timeout: 5s
# retries: 5
# restart: "unless-stopped"
app:
image: localhost/your_app_image_here
build:
context: ./django
# To build image with extra dev tools
#dockerfile: Dockerfile.dev
command: python -m gunicorn myproject.wsgi -b 0.0.0.0:8000
env_file: .env
volumes:
- static_files:/static
- media_files:/media
- docs:/docs
# Comment this out if you're not using SQLite
- ./db:/db
restart: "unless-stopped"
# To use an built-in Postgres server, uncomment this dependency
#depends_on:
# db:
# condition: service_healthy
web:
image: mattcen/nginx_django
build: ./nginx
environment:
# Replace 'app' below with the name of the django service above
WEB_APP_HOST: app:8000
ports:
- "$APP_PORT:80"
depends_on:
- app
volumes:
- static_files:/static
- media_files:/media
- docs:/docs
volumes:
db_data:
static_files:
media_files:
docs: