-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
111 lines (99 loc) · 3.17 KB
/
Copy pathdocker-compose.yml
File metadata and controls
111 lines (99 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
services:
# PostgreSQL Database
postgres:
image: postgres:16
environment:
POSTGRES_USER: ${POSTGRES_USER:-taskosaur}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-taskosaur}
POSTGRES_DB: ${POSTGRES_DB:-taskosaur}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-taskosaur}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- taskosaur-network
restart: unless-stopped
# Redis for Bull Queue
redis:
image: redis:7
command: redis-server ${REDIS_PASSWORD:+--requirepass "$REDIS_PASSWORD"}
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- taskosaur-network
restart: unless-stopped
# Taskosaur Application
app:
image: taskosaur/taskosaur:latest
environment:
# Node Environment
NODE_ENV: ${NODE_ENV:-production}
# Database Configuration (overridden for Docker)
DATABASE_URL: postgresql://${POSTGRES_USER:-taskosaur}:${POSTGRES_PASSWORD:-taskosaur}@postgres:5432/${POSTGRES_DB:-taskosaur}
# Redis Configuration (overridden for Docker)
REDIS_HOST: redis
REDIS_PORT: ${REDIS_PORT:-6379}
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
# Application URLs
FRONTEND_URL: ${FRONTEND_URL:-http://localhost:3000}
CORS_ORIGIN: ${CORS_ORIGIN:-http://localhost:3000}
NEXT_PUBLIC_API_BASE_URL: ${NEXT_PUBLIC_API_BASE_URL:-http://localhost:3000/api}
# Security
JWT_SECRET: ${JWT_SECRET}
JWT_REFRESH_SECRET: ${JWT_REFRESH_SECRET}
JWT_EXPIRES_IN: ${JWT_EXPIRES_IN:-15m}
JWT_REFRESH_EXPIRES_IN: ${JWT_REFRESH_EXPIRES_IN:-7d}
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
# Email Configuration (optional)
SMTP_HOST: ${SMTP_HOST:-}
SMTP_PORT: ${SMTP_PORT:-587}
SMTP_USER: ${SMTP_USER:-}
SMTP_PASS: ${SMTP_PASS:-}
SMTP_FROM: ${SMTP_FROM:-noreply@taskosaur.com}
EMAIL_DOMAIN: ${EMAIL_DOMAIN:-taskosaur.com}
# File Upload
UPLOAD_DEST: ${UPLOAD_DEST:-./uploads}
MAX_FILE_SIZE: ${MAX_FILE_SIZE:-10485760}
# Queue Configuration
MAX_CONCURRENT_JOBS: ${MAX_CONCURRENT_JOBS:-5}
JOB_RETRY_ATTEMPTS: ${JOB_RETRY_ATTEMPTS:-3}
# AWS S3 Configuration (optional)
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:-}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY:-}
AWS_REGION: ${AWS_REGION:-}
AWS_BUCKET_NAME: ${AWS_BUCKET_NAME:-}
ports:
- "3000:3000"
volumes:
- app_uploads:/app/taskosaur/uploads
- app_logs:/app/taskosaur/logs
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- taskosaur-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "node -e \"require('http').get('http://localhost:3000/api/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))\""]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
volumes:
postgres_data:
redis_data:
app_uploads:
app_logs:
networks:
taskosaur-network:
driver: bridge