-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
72 lines (66 loc) · 1.43 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
60
61
62
63
64
65
66
67
68
69
70
71
72
version: "3.8"
x-templates:
default-variables: &default-variables
TZ: UTC
default-service: &default-service
restart: unless-stopped
tty: true
stdin_open: true
init: true
extra_hosts:
- host.docker.internal:host-gateway
environment:
<<: *default-variables
as-current-user: &as-current-user
user: ${DOCKER_UID:-1000}:${DOCKER_GID:-1000}
services:
# PHP
app:
<<:
- *default-service
- *as-current-user
image: user-api/app
build: ./app
container_name: user-api-app
command: "rr serve -c .rr.prod.yaml"
volumes:
- ./app/data/log:/app/data/log
ports:
- "80:80"
networks:
- app
healthcheck:
test: ["CMD", "curl", "--fail", "http://127.0.0.1:2114/health?plugin=http"]
interval: 10s
timeout: 3s
retries: 3
start_period: 10s
# PostgreSQL
db:
<<: *default-service
image: postgres:16-alpine
container_name: user-api-db
environment:
<<: *default-variables
POSTGRES_USER: app
POSTGRES_PASSWORD: app
POSTGRES_DB: app
volumes:
- db-data:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- app
healthcheck:
test: ["CMD", "pg_isready", "-U", "app", "-d", "app"]
interval: 10s
timeout: 3s
retries: 3
start_period: 10s
networks:
app:
driver: bridge
volumes:
db-data:
name: user-api-db-data
driver: local