-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
56 lines (51 loc) · 1.33 KB
/
docker-compose.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
---
services:
web:
depends_on:
- app
image: nginx:${NGINX_VERSION:-1.25.1}-alpine
volumes:
- ${PWD}/templates:/etc/nginx/templates:ro
networks:
- app
ports:
- 8080:80
app:
depends_on:
- db
build:
context: app
args:
- PYTHON_VERSION=${PYTHON_VERSION:-3.11.4}
- POSTGRESQL_VERSION=${POSTGRESQL_VERSION:-15.3}
networks:
- app
- db
environment:
- PGHOST=db
- PGPORT=5432
- PGUSER=postgres
- PGPASSWORD=${POSTGRES_PASSWORD}
stop_signal: SIGINT
deploy:
replicas: 3
db:
image: postgres:${POSTGRESQL_VERSION:-15.3}-alpine
networks:
- db
volumes:
- pgdata:/var/lib/postgresql/data/pgdata:rw
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
# ! If the data volume you're using is a filesystem mountpoint (like with
# ! GCE persistent disks), or remote folder that cannot be chowned to the
# ! postgres user (like some NFS mounts), or contains folders/files (e.g.
# ! lost+found), Postgres initdb requires a subdirectory to be created
# ! within the mountpoint to contain the data.
# ? https://github.com/docker-library/docs/tree/master/postgres#pgdata
- PGDATA=/var/lib/postgresql/data/pgdata
networks:
app:
db:
volumes:
pgdata: