-
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.49 KB
/
docker-compose.yml
File metadata and controls
65 lines (62 loc) · 1.49 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:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: sportsadmin
POSTGRES_PASSWORD: sportsadmin
POSTGRES_DB: sportsadmin
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U sportsadmin"]
interval: 5s
timeout: 5s
retries: 5
api:
build:
context: .
dockerfile: api/Dockerfile
target: build
working_dir: /app/api
command: npm run dev
env_file:
- .env
environment:
DATABASE_URL: postgresql://sportsadmin:sportsadmin@postgres:5432/sportsadmin
SESSION_SECRET: dev-secret-do-not-use-in-production
PORT: 3000
APP_ENV: development
CORS_ORIGIN: http://localhost:5173
LOG_LEVEL: debug
ports:
- "3000:3000"
volumes:
- ./api/src:/app/api/src # hot reload
- ./shared:/app/shared
- /app/api/node_modules
- /app/node_modules
depends_on:
postgres:
condition: service_healthy
client:
build:
context: .
dockerfile: client/Dockerfile
target: build
working_dir: /app/client
command: npm run dev -- --host
environment:
VITE_API_URL: http://localhost:3000
ports:
- "5173:5173"
volumes:
- ./client/src:/app/client/src # hot reload
- ./shared:/app/shared
- /app/client/node_modules
- /app/node_modules
depends_on:
- api
volumes:
postgres_data: