-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
79 lines (75 loc) · 2.05 KB
/
docker-compose.yaml
File metadata and controls
79 lines (75 loc) · 2.05 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
services:
app:
# The container name must be "application-server"
container_name: "application-server"
image: "caddy:2.11-alpine"
restart: always
volumes:
- ./caddy:/etc/caddy:ro
- caddy_data:/data
ports:
- 8080:8080
networks:
- app-network
- playground-apps
playground:
build:
context: ./playground
container_name: "playground"
user: "playground:${DOCKER_GID}"
restart: always
depends_on:
app:
condition: service_started
db:
condition: service_healthy
environment:
PORT: "8080"
DB_HOST: "db"
DB_PORT: "5432"
DB_NAME: "playground"
DB_USER: "playground_user"
DB_PASSWORD: "playground_password"
CADDY_HOST: "application-server"
CADDY_PORT: "2019"
volumes:
# mount Host machine's docker.sock to container's docker.sock
- /var/run/docker.sock:/var/run/docker.sock
# mount Host machine's /etc/group to container's /etc/host-group
- /etc/group:/etc/host-group
# mount apps directory for devcontainer builds
- ./apps:/workspace/apps
# mount startup scripts from parent directory
- ./startupscript:/workspace/startupscript
# mount features directory for devcontainer features
- ../../features:/workspace/features:ro
networks:
- playground-apps
- playground
db:
image: "postgres:18-alpine"
restart: always
environment:
POSTGRES_USER: "playground_user"
POSTGRES_PASSWORD: "playground_password"
POSTGRES_DB: "playground"
volumes:
- pg_data:/var/lib/postgresql/data
networks:
- playground
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
volumes:
caddy_data:
pg_data:
networks:
# The Docker network must be named "app-network". This is an external network
# that is created outside of this docker-compose file.
app-network:
external: true
playground:
playground-apps: