-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
106 lines (101 loc) · 2.86 KB
/
docker-compose.yml
File metadata and controls
106 lines (101 loc) · 2.86 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
version: "3.8"
services:
# Garage service for object storage
garage:
image: dxflrs/garage:v2.2.0
expose:
- "3900"
- "3901"
- "3902"
ports:
- "3900:3900"
- "3901:3901"
volumes:
- ./garage.toml:/etc/garage.toml:ro
- garage_meta:/var/lib/garage/meta
- garage_data:/var/lib/garage/data
command: ["/garage", "-c", "/etc/garage.toml", "server"]
healthcheck:
test: ["CMD", "/garage", "-c", "/etc/garage.toml", "status"]
interval: 5s
timeout: 10s
retries: 3
start_period: 10s
restart: unless-stopped
# Garage setup service for initial bucket and key provisioning
garage-init:
build:
context: .
dockerfile: docker/garage-init/Dockerfile
depends_on:
garage:
condition: service_healthy
environment:
- S3_ACCESS_KEY=${S3_ACCESS_KEY:-GK000000000000000000000000}
- S3_SECRET_KEY=${S3_SECRET_KEY:-0000000000000000000000000000000000000000000000000000000000000000}
- S3_BUCKET=${S3_BUCKET:-images}
- GARAGE_ZONE=${GARAGE_ZONE:-local}
- GARAGE_CAPACITY=${GARAGE_CAPACITY:-1G}
- GARAGE_KEY_NAME=${GARAGE_KEY_NAME:-resize-it}
volumes:
- ./garage.toml:/etc/garage.toml:ro
- ./scripts/init-garage.sh:/init-garage.sh:ro
- garage_meta:/var/lib/garage/meta
restart: "no"
# Dragonfly service for caching
dragonfly:
image: docker.dragonflydb.io/dragonflydb/dragonfly:latest
ulimits:
memlock: -1
expose:
- "6379"
volumes:
- dragonfly_data:/data
healthcheck:
test: ["CMD", "redis-cli", "-h", "localhost", "ping"]
interval: 5s
timeout: 10s
retries: 3
start_period: 5s
restart: unless-stopped
# API service
api:
build:
context: ./packages/api
dockerfile: Dockerfile
expose:
- "3000"
ports:
- "3005:3000"
environment:
- S3_ENDPOINT=garage
- S3_PORT=3900
- S3_USE_SSL=false
- S3_ACCESS_KEY=${S3_ACCESS_KEY:-GK000000000000000000000000}
- S3_SECRET_KEY=${S3_SECRET_KEY:-0000000000000000000000000000000000000000000000000000000000000000}
- S3_BUCKET=${S3_BUCKET:-images}
- ENABLE_API_KEY_AUTH=false
- CORS_ALLOWED_ORIGINS=${CORS_ALLOWED_ORIGINS:-*}
- DRAGONFLY_HOST=dragonfly
- DRAGONFLY_PORT=6379
- DRAGONFLY_ENABLED=true
depends_on:
garage-init:
condition: service_completed_successfully
dragonfly:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/admin/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 15s
# Define named volumes for data persistence
volumes:
garage_meta:
name: resize-it-garage-meta
garage_data:
name: resize-it-garage-data
dragonfly_data:
name: resize-it-dragonfly-data