-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
97 lines (87 loc) · 2.73 KB
/
docker-compose.yml
File metadata and controls
97 lines (87 loc) · 2.73 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
version: "3.9"
services:
mongo:
image: mongo:7.0
container_name: senzore-mongo
restart: unless-stopped
environment:
# 🔐 CHANGE THESE IN REAL DEPLOYMENTS
MONGO_INITDB_ROOT_USERNAME: senzore_root
MONGO_INITDB_ROOT_PASSWORD: "${MONGO_ROOT_PASSWORD}"
MONGO_INITDB_DATABASE: senzore
volumes:
- mongo_data:/data/db
ports:
# Expose only if you really need local access from host.
- "27017:27017"
networks:
- senzore-net
command: ["--bind_ip_all", "--auth"]
# Optional healthcheck – comment out if it ever causes issues.
healthcheck:
test:
[
"CMD",
"mongosh",
"--username",
"senzore_root",
"--password",
"${MONGO_ROOT_PASSWORD}",
"--eval",
"db.adminCommand('ping')",
]
interval: 10s
timeout: 5s
retries: 5
core:
build:
context: ./core
# dockerfile: Dockerfile # (default name; add if you name it differently)
container_name: senzore-core
restart: unless-stopped
depends_on:
- mongo
# If your Docker version supports it, you can instead use:
# mongo:
# condition: service_healthy
environment:
# Server config
PORT: "5000"
NODE_ENV: "production"
# Mongo connection – from *inside* the core container, Mongo is "mongo"
# You originally wrote http://localhost:27017/senzore, but Mongo URIs use mongodb://
MONGO_URI: "mongodb://senzore_root:${MONGO_ROOT_PASSWORD}@mongo:27017/senzore?authSource=admin"
# You will provide this value (a single-line JSON string)
FIREBASE_SERVICE_ACCOUNT: "${FIREBASE_SERVICE_ACCOUNT}"
# You can add any other envs you already use here as needed
ports:
- "5000:5000"
networks:
- senzore-net
console:
build:
context: ./console
# dockerfile: Dockerfile # (default name)
container_name: senzore-console
restart: unless-stopped
depends_on:
- core
environment:
# This is what the browser sees, so keep localhost + exposed port.
# In your README the frontend expects /api at the end, so keeping that here. :contentReference[oaicite:0]{index=0}
NEXT_PUBLIC_API_URL: "http://localhost:5000/api"
# You will provide all these from your Firebase project
NEXT_PUBLIC_FIREBASE_API_KEY: "${NEXT_PUBLIC_FIREBASE_API_KEY}"
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: "${NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN}"
NEXT_PUBLIC_FIREBASE_PROJECT_ID: "${NEXT_PUBLIC_FIREBASE_PROJECT_ID}"
# Optional
NODE_ENV: "production"
ports:
- "3000:3000"
networks:
- senzore-net
volumes:
mongo_data:
networks:
senzore-net:
driver: bridge