-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
99 lines (93 loc) · 2.38 KB
/
docker-compose.yml
File metadata and controls
99 lines (93 loc) · 2.38 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
version: '3.8'
services:
# MongoDB Database
mongodb:
image: mongo:6.0
container_name: taskly-mongodb
restart: unless-stopped
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USERNAME:-admin}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD:-password}
MONGO_INITDB_DATABASE: ${MONGO_DB_NAME:-taskly}
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
- ./backend/seeds:/docker-entrypoint-initdb.d
networks:
- taskly-network
# Backend API
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: taskly-backend
restart: unless-stopped
environment:
NODE_ENV: production
PORT: 5000
MONGODB_URI: mongodb://mongodb:27017/${MONGO_DB_NAME:-taskly}
JWT_SECRET: ${JWT_SECRET:-your-super-secure-jwt-secret}
SESSION_SECRET: ${SESSION_SECRET:-your-super-secure-session-secret}
CLIENT_URL: ${CLIENT_URL:-http://localhost:3000}
CLOUDINARY_CLOUD_NAME: ${CLOUDINARY_CLOUD_NAME}
CLOUDINARY_API_KEY: ${CLOUDINARY_API_KEY}
CLOUDINARY_API_SECRET: ${CLOUDINARY_API_SECRET}
ports:
- "5000:5000"
depends_on:
- mongodb
volumes:
- ./backend/logs:/app/logs
networks:
- taskly-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/api/health"]
interval: 30s
timeout: 10s
retries: 3
# Frontend Application
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
VITE_API_URL: ${VITE_API_URL:-http://localhost:5000/api}
VITE_APP_NAME: ${VITE_APP_NAME:-Taskly}
container_name: taskly-frontend
restart: unless-stopped
ports:
- "3000:80"
depends_on:
- backend
networks:
- taskly-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/health"]
interval: 30s
timeout: 10s
retries: 3
# Nginx Reverse Proxy (Optional)
nginx:
image: nginx:alpine
container_name: taskly-nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/ssl:/etc/nginx/ssl
depends_on:
- frontend
- backend
networks:
- taskly-network
profiles:
- production
volumes:
mongodb_data:
driver: local
networks:
taskly-network:
driver: bridge