@@ -13,74 +13,14 @@ services:
1313 - .env
1414 environment :
1515 NODE_ENV : production
16-
17- DATABASE_URL : postgres://postgres:postgres@postgres:5432/photos
18- REDIS_URL : redis://dragonfly:6379
19- NEXTAUTH_URL : https://photos.hackclub.com
20-
2116 depends_on :
22- postgres :
23- condition : service_healthy
24- dragonfly :
25- condition : service_started
2617 migrate :
2718 condition : service_completed_successfully
2819
29- # (Removed resource limits to prioritize raw throughput)
30-
3120 migrate :
3221 build :
3322 context : .
3423 dockerfile : Dockerfile
3524 target : migration
36- environment :
37- DATABASE_URL : postgres://postgres:postgres@postgres:5432/photos
38- depends_on :
39- postgres :
40- condition : service_healthy
41-
42- postgres :
43- image : postgres:16-alpine
44- container_name : hack-club-photos-postgres
45- restart : unless-stopped
46- environment :
47- POSTGRES_USER : postgres
48- POSTGRES_PASSWORD : postgres
49- POSTGRES_DB : photos
50- volumes :
51- - postgres_data:/var/lib/postgresql/data
52- healthcheck :
53- test : ["CMD-SHELL", "pg_isready -U postgres -d photos -h 127.0.0.1"]
54- interval : 10s
55- timeout : 5s
56- retries : 5
57-
58- # Small/medium deployment tuning (adjust to your machine)
59- command :
60- - " postgres"
61- - " -c"
62- - " shared_buffers=256MB"
63- - " -c"
64- - " effective_cache_size=768MB"
65- - " -c"
66- - " work_mem=16MB"
67- - " -c"
68- - " maintenance_work_mem=128MB"
69- - " -c"
70- - " max_connections=200"
71-
72- # (Removed log rotation limits to keep config minimal; add back if disk logs become an issue)
73-
74- dragonfly :
75- image : docker.dragonflydb.io/dragonflydb/dragonfly
76- container_name : hack-club-photos-dragonfly
77- restart : unless-stopped
78- # Prioritize speed: allow Dragonfly to use available RAM and avoid snapshot overhead.
79- # If you want durability, re-add --save_schedule and/or AOF-like persistence.
80- command : ["--maxmemory=0"]
81- volumes :
82- - dragonfly_data:/data
83-
84- volumes :
85- postgres_data :
86- dragonfly_data :
25+ env_file :
26+ - .env
0 commit comments