-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
65 lines (62 loc) · 1.66 KB
/
Copy pathdocker-compose.yml
File metadata and controls
65 lines (62 loc) · 1.66 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
services:
db:
image: postgres:16-alpine
container_name: rostid_db
restart: unless-stopped
environment:
POSTGRES_USER: rostid
POSTGRES_PASSWORD: rostid_password
POSTGRES_DB: rostid_db
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U rostid -d rostid_db']
interval: 10s
timeout: 5s
retries: 5
server:
build:
context: ./server
dockerfile: Dockerfile.dev
container_name: rostid_server
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
NODE_ENV: development
PORT: 4000
DATABASE_URL: postgresql://rostid:rostid_password@db:5432/rostid_db
JWT_ACCESS_SECRET: dev-access-secret-change-in-prod-32chars
JWT_REFRESH_SECRET: dev-refresh-secret-change-in-prod-32chars
JWT_ACCESS_EXPIRES_IN: 15m
JWT_REFRESH_EXPIRES_IN: 7d
CLIENT_URL: http://localhost:5173
COOKIE_SECRET: dev-cookie-secret-change-in-prod
ports:
- '4000:4000'
volumes:
- ./server:/app
- /app/node_modules
command: sh -c "npx prisma db push --accept-data-loss && npx prisma db seed && npm run dev"
client:
build:
context: ./client
dockerfile: Dockerfile.dev
container_name: rostid_client
restart: unless-stopped
depends_on:
- server
environment:
VITE_API_URL: http://localhost:4000/api
API_PROXY_TARGET: http://rostid_server:4000
ports:
- '5173:5173'
volumes:
- ./client:/app
- /app/node_modules
command: npm run dev -- --host
volumes:
postgres_data: