-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
61 lines (57 loc) · 1.4 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
57
58
59
60
61
services:
postgres:
image: "${POSTGRES_IMAGE:-postgres:15.3-bookworm}"
volumes:
- learning-platform-data:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
environment:
POSTGRES_USER: "${POSTGRES_USER:-postgres}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-1234}"
POSTGRES_DB: "${POSTGRES_DB:-csudh_dev}"
healthcheck:
test: ["CMD", "pg_isready", "-U", "${POSTGRES_USER:-postgres}"]
interval: 2s
timeout: 1s
retries: 3
backend:
build:
context: ./backend
dockerfile: Dockerfile
ports:
- 4000:4000
depends_on:
postgres:
condition: service_healthy # Wait until postgres is healthy
env_file:
- ./backend/.env
volumes:
- ./backend:/app
- ./content:/app/content
backend-test:
build:
context: ./backend
dockerfile: Dockerfile
depends_on:
postgres:
condition: service_healthy
env_file:
- ./backend/.env.test
command: ["go", "test", "-cover", "./internal/...", "-v"]
volumes:
- ./backend:/app
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- 3000:3000
depends_on:
- backend
environment:
- HOST=0.0.0.0
- WATCHPACK_POLLING=true
volumes:
- './frontend:/app'
- ./content:/app/public/content
volumes:
learning-platform-data: