-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
80 lines (75 loc) · 1.76 KB
/
docker-compose.yml
File metadata and controls
80 lines (75 loc) · 1.76 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
services:
# INFRASTRUCTURE (DB & Cache)
postgres:
image: postgis/postgis:15-3.3
container_name: surplus_db
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- "${POSTGRES_PORT}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
redis:
image: redis:alpine
container_name: surplus_redis
restart: always
ports:
- "${REDIS_PORT}:6379"
command: redis-server --appendonly yes
pgadmin:
image: dpage/pgadmin4
container_name: surplus_pgadmin
restart: always
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_PASSWORD}
ports:
- "5050:80"
depends_on:
- postgres
# BACKEND (NestJS)
backend:
build:
context: .
dockerfile: backend/Dockerfile
target: dev
container_name: surplus_backend
ports:
- "3000:3000"
env_file: .env
environment:
DATABASE_HOST: postgres
DATABASE_PORT: 5432
REDIS_HOST: redis
REDIS_PORT: 6379
depends_on:
- postgres
- redis
# Mount volume for Hot Reloading
volumes:
- ./backend:/app/backend
- /app/backend/node_modules
- ./shared:/app/shared
# FRONTEND (React + Vite)
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: surplus_frontend
ports:
- "5173:5173"
env_file: .env
environment:
VITE_API_URL: http://localhost:3000
depends_on:
- backend
command: sh -c "npm install ; npm run dev -- --host"
# Mount volume for Hot Reloading
volumes:
- ./frontend:/app
- /app/node_modules
volumes:
postgres_data: