-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
48 lines (44 loc) · 1010 Bytes
/
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
services:
nextjs:
image: nextjs:latest
container_name: nextjs
ports:
- "3000:3000"
restart: always
depends_on:
db_postgres:
condition: service_healthy
restart: true
environment:
- DATABASE_URL=${DATABASE_URL}
profiles: ["prod", "staging"]
db_postgres:
image: postgres:16-alpine
container_name: db_postgres
environment:
- POSTGRES_USER=${PGSQL_USER}
- POSTGRES_PASSWORD=${PGSQL_PASSWORD}
restart: always
ports:
- "5432:5432"
volumes:
- db_postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 10s
retries: 5
start_period: 30s
timeout: 10s
profiles: ["prod", "staging"]
nginx:
image: nginx:latest
container_name: nginx
ports:
- "80:80"
- "443:443"
volumes:
- /etc/ssl:/etc/nginx/ssl:ro
restart: always
profiles: ["prod", "staging"]
volumes:
db_postgres: