-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
140 lines (129 loc) · 3.17 KB
/
docker-compose.prod.yml
File metadata and controls
140 lines (129 loc) · 3.17 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# Docker Compose configuration for Vinci Clips production
version: '3.8'
services:
# MongoDB database
mongodb:
image: mongo:7.0
container_name: vinci-clips-mongodb-prod
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD}
MONGO_INITDB_DATABASE: vinci-clips
volumes:
- mongodb_data:/data/db
- ./scripts/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
networks:
- vinci-network
# Don't expose ports in production - access via internal network only
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Redis for caching
redis:
image: redis:7-alpine
container_name: vinci-clips-redis-prod
restart: always
volumes:
- redis_data:/data
networks:
- vinci-network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Backend API service
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: vinci-clips-backend-prod
restart: always
environment:
# Server config
PORT: 8080
NODE_ENV: production
# Database
DB_URL: mongodb://${MONGO_ROOT_USERNAME}:${MONGO_ROOT_PASSWORD}@mongodb:27017/vinci-clips?authSource=admin
# Google Cloud
GCP_BUCKET_NAME: ${GCP_BUCKET_NAME}
GCP_SERVICE_ACCOUNT_PATH: /app/gcp-service-account.json
GEMINI_API_KEY: ${GEMINI_API_KEY}
# Redis
REDIS_HOST: redis
REDIS_PORT: 6379
# Security
CORS_ORIGIN: ${CORS_ORIGIN:-https://yourdomain.com}
expose:
- "8080"
volumes:
- ./backend/temp:/app/temp
- ./backend/cache:/app/cache
- ./backend/logs:/app/logs
- ${GCP_SERVICE_ACCOUNT_PATH}:/app/gcp-service-account.json:ro
depends_on:
- mongodb
- redis
networks:
- vinci-network
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "5"
# Frontend Next.js application
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: vinci-clips-frontend-prod
restart: always
environment:
NODE_ENV: production
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-https://api.yourdomain.com}
expose:
- "3000"
depends_on:
- backend
networks:
- vinci-network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Nginx reverse proxy for production
nginx:
image: nginx:alpine
container_name: vinci-clips-nginx-prod
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/ssl:/etc/nginx/ssl:ro
- nginx_logs:/var/log/nginx
depends_on:
- frontend
- backend
networks:
- vinci-network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
vinci-network:
driver: bridge
volumes:
mongodb_data:
driver: local
redis_data:
driver: local
nginx_logs:
driver: local