-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
56 lines (51 loc) · 1.34 KB
/
docker-compose.yml
File metadata and controls
56 lines (51 loc) · 1.34 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
version: "3.8"
services:
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "3000:3000"
depends_on:
- backend
backend:
build:
context: ./backend
dockerfile: Dockerfile
ports:
- "5000:5000"
depends_on:
- db
environment:
- PORT=5000
- NODE_ENV=production
- DATABASE_URL=postgresql://codesprint_user:codesprint_password@db:5432/codesprint
- DIRECT_URL=postgresql://codesprint_user:codesprint_password@db:5432/codesprint
- JWT_SECRET=${JWT_SECRET}
- GEMINI_API_KEY=${GEMINI_API_KEY}
db:
image: postgres:14
environment:
POSTGRES_USER: codesprint_user
POSTGRES_PASSWORD: codesprint_password
POSTGRES_DB: codesprint
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U codesprint_user -d codesprint"]
interval: 5s
timeout: 5s
retries: 5
db-setup:
build:
context: ./backend
dockerfile: Dockerfile
command: sh -c "npm run db:setup"
depends_on:
db:
condition: service_healthy
environment:
- DATABASE_URL=postgresql://codesprint_user:codesprint_password@db:5432/codesprint
- DIRECT_URL=postgresql://codesprint_user:codesprint_password@db:5432/codesprint
volumes:
postgres_data: