-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
57 lines (54 loc) · 1.32 KB
/
Copy pathcompose.yaml
File metadata and controls
57 lines (54 loc) · 1.32 KB
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
services:
django-app:
image: wtukatyr/django-example-app:latest
restart: unless-stopped
container_name: django-app
ports:
- "8989:8000"
depends_on:
- db
volumes:
- ./mysite:/app/mysite
- ./polls:/app/polls
environment:
DATABASE_NAME: ${DATABASE_NAME}
DATABASE_USERNAME: ${DATABASE_USERNAME}
DATABASE_HOST: ${DATABASE_HOST}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
DATABASE_PORT: ${DATABASE_PORT}
env_file:
- .env
networks:
- django_app_network
- proxy_common
db:
image: postgres:14
restart: always
# set shared memory limit when using docker compose
shm_size: 128mb
# or set shared memory limit when deploy via swarm stack
#volumes:
# - type: tmpfs
# target: /dev/shm
# tmpfs:
# size: 134217728 # 128*2^20 bytes = 128Mb
container_name: postgres
volumes:
- pg-data:/var/lib/postgresql/data
environment:
POSTGRES_DB: ${DATABASE_NAME}
POSTGRES_USER: ${DATABASE_USERNAME}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
POSTGRES_PORT: ${DATABASE_PORT}
env_file:
- .env
networks:
- django_app_network
- proxy_common
volumes:
pg-data:
networks:
django_app_network:
name: django_app_network
proxy_common:
external: true