-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.prod.yml
59 lines (55 loc) · 1.4 KB
/
docker-compose.prod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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: