Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
70 lines (66 loc) · 1.75 KB
/
Copy pathdocker-compose.yml
File metadata and controls
70 lines (66 loc) · 1.75 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
# Local Postgres by default: docker compose up -d
# The whole stack from source: docker compose --profile app up --build
# The app profile builds the API with the root course sources and runs migrations first.
services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: buildment
POSTGRES_PASSWORD: buildment
POSTGRES_DB: buildment
ports:
- "5432:5432"
volumes:
- buildment-postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U buildment -d buildment"]
interval: 5s
timeout: 3s
retries: 10
migrate:
profiles: ["app"]
build:
context: .
dockerfile: server/Dockerfile
command: ["pnpm", "exec", "prisma", "migrate", "deploy"]
environment:
DATABASE_URL: postgresql://buildment:buildment@postgres:5432/buildment
depends_on:
postgres:
condition: service_healthy
api:
profiles: ["app"]
build:
context: .
dockerfile: server/Dockerfile
restart: unless-stopped
env_file:
- path: server/.env
required: false
environment:
DATABASE_URL: postgresql://buildment:buildment@postgres:5432/buildment
APP_URL: http://localhost:3000
CORS_ORIGINS: http://localhost:3000
PORT: "4000"
ports:
- "4000:4000"
depends_on:
migrate:
condition: service_completed_successfully
web:
profiles: ["app"]
build: ./frontend
restart: unless-stopped
env_file:
- path: frontend/.env
required: false
environment:
API_URL: http://api:4000
APP_URL: http://localhost:3000
ports:
- "3000:3000"
depends_on:
- api
volumes:
buildment-postgres-data: