-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
64 lines (61 loc) · 1.58 KB
/
docker-compose.yml
File metadata and controls
64 lines (61 loc) · 1.58 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
services:
db:
image: postgres:17
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: citations_tracker
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
timeout: 5s
retries: 10
migrate:
image: node:20-slim
working_dir: /app
volumes:
- .:/app
- node_modules:/app/node_modules
- web_node_modules:/app/web/node_modules
- pnpm_store:/app/.pnpm-store
- web_next:/app/web/.next
environment:
DATABASE_URL: postgresql://postgres:postgres@db:5432/citations_tracker
CI: "true"
command: >
sh -c "corepack enable && pnpm install && pnpm --filter web db:migrate && pnpm --filter web db:seed"
depends_on:
db:
condition: service_healthy
web:
image: node:20-slim
working_dir: /app
volumes:
- .:/app
- node_modules:/app/node_modules
- web_node_modules:/app/web/node_modules
- pnpm_store:/app/.pnpm-store
- web_next:/app/web/.next
ports:
- "3000:3000"
environment:
DATABASE_URL: postgresql://postgres:postgres@db:5432/citations_tracker
env_file:
- .env
command: sh -c "corepack enable && pnpm install && pnpm --filter web dev"
depends_on:
db:
condition: service_healthy
migrate:
condition: service_completed_successfully
volumes:
postgres_data:
node_modules:
web_node_modules:
pnpm_store:
web_next: