forked from Sachinchaurasiya360/InternHack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
63 lines (60 loc) · 1.6 KB
/
docker-compose.yml
File metadata and controls
63 lines (60 loc) · 1.6 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
services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-internhack}
volumes:
- internhack_pgdata:/var/lib/postgresql/data
healthcheck:
test:
["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-internhack}"]
interval: 5s
timeout: 5s
retries: 10
# Map only if you need host tools against DB; uncomment if nothing else uses port 5432 locally.
# ports:
# - "5432:5432"
server:
build:
context: ./server
dockerfile: Dockerfile.dev
restart: unless-stopped
env_file:
- path: .env
required: false
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:5432/${POSTGRES_DB:-internhack}
CHOKIDAR_USEPOLLING: "true"
volumes:
- ./server:/app
- server_node_modules:/app/node_modules
ports:
- "3000:3000"
depends_on:
postgres:
condition: service_healthy
client:
build:
context: ./client
dockerfile: Dockerfile
restart: unless-stopped
env_file:
- path: .env
required: false
environment:
DOCKER_INTERNAL_API_ORIGIN: http://server:3000
CHOKIDAR_USEPOLLING: "true"
volumes:
- ./client:/app
- client_node_modules:/app/node_modules
ports:
- "5173:5173"
depends_on:
- server
volumes:
internhack_pgdata:
server_node_modules:
client_node_modules: