-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
72 lines (68 loc) · 1.75 KB
/
docker-compose.yml
File metadata and controls
72 lines (68 loc) · 1.75 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
services:
# MongoDB service (optional - can use existing cloud MongoDB)
# Uncomment if you want to use a local MongoDB container
# mongodb:
# image: mongo:7
# container_name: fieldnotes-mongodb
# restart: unless-stopped
# environment:
# MONGO_INITDB_ROOT_USERNAME: admin
# MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD:-changeme}
# MONGO_INITDB_DATABASE: fieldnotes
# ports:
# - "27017:27017"
# volumes:
# - mongodb_data:/data/db
# networks:
# - fieldnotes-network
# Backend API service
backend:
build:
context: ./back-end
dockerfile: Dockerfile
container_name: fieldnotes-backend
restart: unless-stopped
ports:
- "7001:7001"
environment:
- NODE_ENV=${NODE_ENV:-production}
- PORT=7001
- MONGODB_URI=${MONGODB_URI}
- JWT_SECRET=${JWT_SECRET}
- USE_MOCK_DB=${USE_MOCK_DB:-false}
# depends_on:
# - mongodb
networks:
- fieldnotes-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:7001/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Frontend service
frontend:
build:
context: ./front-end
dockerfile: Dockerfile
container_name: fieldnotes-frontend
restart: unless-stopped
ports:
- "80:80"
depends_on:
- backend
networks:
- fieldnotes-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
networks:
fieldnotes-network:
driver: bridge
# Uncomment if using local MongoDB
# volumes:
# mongodb_data:
# driver: local