Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
69 lines (60 loc) · 1.82 KB
/
Copy pathdocker-compose.yml
File metadata and controls
69 lines (60 loc) · 1.82 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
version: "3.8"
services:
# Backend Service (Node.js)
backend:
build:
context: ./expensy_backend
environment:
- DATABASE_URI=mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@${MONGO_HOST}:${MONGO_PORT}/?authSource=${MONGO_DB}
- REDIS_HOST=${REDIS_HOST}
- REDIS_PORT=${REDIS_PORT}
- REDIS_PASSWORD=${REDIS_PASSWORD}
ports:
- "8706:8706" # Expose backend on port 8707 locally 8707:8706
depends_on:
- redis # Ensure Redis is available before starting the backend
- mongo # Ensure MongoDB is available before starting the backend
networks:
- expensy
# Frontend Service (Next.js)
frontend:
build:
context: ./expensy_frontend
environment:
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL} # API URL for frontend to communicate with backend
ports:
- "3002:3000" # Expose frontend on port 3002
depends_on:
- backend # Ensure the backend is up before starting the frontend
networks:
- expensy
# Redis Service
redis:
image: redis
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD}
ports:
- "6379:6379" # Expose Redis on port 6379
networks:
- expensy
# MongoDB Service
mongo:
image: mongo
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_INITDB_ROOT_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_INITDB_ROOT_PASSWORD}
ports:
- "27017:27017" # Expose MongoDB on port 27017
volumes:
- type: volume
source: mongo_data
target: /data/db
networks:
- expensy
# Define volumes for data persistence
volumes:
mongo_data:
# Define a custom network for the services
networks:
expensy:
driver: bridge