-
Notifications
You must be signed in to change notification settings - Fork 125
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
65 lines (59 loc) · 1.36 KB
/
docker-compose.yml
File metadata and controls
65 lines (59 loc) · 1.36 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:16-alpine
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: remitlend
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d remitlend"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:alpine
restart: always
ports:
- "6380:6379"
backend:
build:
context: ./backend
target: builder
command: sh -c "npm run migrate:up && npm run dev"
ports:
- "3001:3001"
env_file:
- ./backend/.env
environment:
- DATABASE_URL=postgres://postgres:postgres@db:5432/remitlend
- REDIS_URL=redis://redis:6379
volumes:
- ./backend/src:/app/src
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
restart: unless-stopped
frontend:
build:
context: ./frontend
target: development
ports:
- "3000:3000"
environment:
- NEXT_PUBLIC_API_URL=http://localhost:3001 # Client-side URL
- API_URL=http://backend:3001 # Server-side URL
volumes:
- ./frontend/src:/app/src
- ./frontend/public:/app/public
depends_on:
- backend
restart: unless-stopped
volumes:
pgdata: