-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.nginx.yml
More file actions
98 lines (93 loc) · 2.42 KB
/
Copy pathdocker-compose.nginx.yml
File metadata and controls
98 lines (93 loc) · 2.42 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
services:
nginx:
image: nginx:alpine
ports:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- app
restart: unless-stopped
networks:
- default
app:
build:
context: .
dockerfile: Dockerfile
expose:
- "3000"
- "8000"
env_file:
- .env
environment:
- NODE_ENV=production
- NEXT_PUBLIC_API_PORT=8000
- ALLOWED_ORIGINS=*
- DATABASE_URL=postgresql+asyncpg://imagemagick:imagemagick@postgres:5432/imagemagick
- REDIS_URL=redis://redis:6379/0
- SECRET_KEY=${SECRET_KEY:-supersecretkey_change_in_production_2024}
- JWT_SECRET=${JWT_SECRET:-jwt_secret_key_change_this_in_production}
- REQUIRE_LOGIN=${REQUIRE_LOGIN:-false}
- ALLOW_REGISTRATION=${ALLOW_REGISTRATION:-true}
- DEFAULT_OUTPUT_FORMAT=${DEFAULT_OUTPUT_FORMAT:-webp}
- DEFAULT_QUALITY=${DEFAULT_QUALITY:-85}
- MAX_UPLOAD_SIZE_MB=${MAX_UPLOAD_SIZE_MB:-100}
- IMAGEMAGICK_TIMEOUT=${IMAGEMAGICK_TIMEOUT:-30}
- IMAGEMAGICK_MEMORY_LIMIT=${IMAGEMAGICK_MEMORY_LIMIT:-2GB}
- HISTORY_RETENTION_HOURS=${HISTORY_RETENTION_HOURS:-24}
- TZ=UTC
volumes:
- uploads:/app/uploads
- processed:/app/processed
- temp:/tmp/imagemagick
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
networks:
- default
postgres:
image: postgres:16-alpine
environment:
- POSTGRES_USER=imagemagick
- POSTGRES_PASSWORD=imagemagick
- POSTGRES_DB=imagemagick
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U imagemagick"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- default
redis:
image: redis:7-alpine
command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- default
volumes:
postgres_data:
redis_data:
uploads:
processed:
temp:
networks:
default:
driver: bridge