-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
86 lines (82 loc) · 2.25 KB
/
docker-compose.prod.yml
File metadata and controls
86 lines (82 loc) · 2.25 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
version: "3.8"
services:
# Backend API Service (Node.js + Express + Firebase)
backend:
image: campuscare/backend:latest
build:
context: ./backend
dockerfile: Dockerfile
container_name: campuscare-backend
restart: always
environment:
NODE_ENV: production
PORT: 3001
# Firebase credentials (from .env file)
FIREBASE_PROJECT_ID: ${FIREBASE_PROJECT_ID}
FIREBASE_PRIVATE_KEY: ${FIREBASE_PRIVATE_KEY}
FIREBASE_CLIENT_EMAIL: ${FIREBASE_CLIENT_EMAIL}
# Google APIs
GOOGLE_GEMINI_API_KEY: ${GOOGLE_GEMINI_API_KEY}
# Application config
API_BASE_URL: ${API_BASE_URL:-http://localhost:3001}
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-http://localhost:3000}
env_file:
- .env
expose:
- "3001"
networks:
- campuscare-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3001/health"]
interval: 30s
timeout: 10s
retries: 3
# Frontend Application (Next.js)
frontend:
image: campuscare/frontend:latest
build:
context: ./frontend
dockerfile: Dockerfile
container_name: campuscare-frontend
restart: always
depends_on:
backend:
condition: service_healthy
environment:
# Backend API
NEXT_PUBLIC_API_BASE_URL: http://backend:3001
# Firebase Web SDK
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}
NEXT_PUBLIC_FIREBASE_APP_ID: ${NEXT_PUBLIC_FIREBASE_APP_ID}
env_file:
- .env
expose:
- "3000"
networks:
- campuscare-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 30s
timeout: 10s
retries: 3
# Reverse Proxy (Nginx) - Optional for production
nginx:
image: nginx:latest
container_name: campuscare-nginx
restart: always
depends_on:
- frontend
- backend
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
networks:
- campuscare-network
networks:
campuscare-network:
driver: bridge