-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.minio.yaml
More file actions
61 lines (59 loc) · 1.82 KB
/
docker-compose.minio.yaml
File metadata and controls
61 lines (59 loc) · 1.82 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
services:
minio:
image: minio/minio:RELEASE.2025-01-20T00-00-00Z
container_name: ofeed-minio
restart: unless-stopped
env_file: ./apps/server/.env
command: server /data --address ":9000" --console-address ":9001"
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio-data:/data
networks:
- app-network
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:9000/minio/health/ready || exit 1"]
interval: 10s
timeout: 5s
retries: 5
minio-init:
image: minio/mc:RELEASE.2025-01-17T23-25-50Z
container_name: ofeed-minio-init
depends_on:
minio:
condition: service_healthy
env_file: ./apps/server/.env
entrypoint: >
/bin/sh -c "
mc alias set local http://minio:9000 $$MINIO_ROOT_USER $$MINIO_ROOT_PASSWORD;
mc mb -p local/$$S3_BUCKET_PUBLIC || true;
mc anonymous set download local/$$S3_BUCKET_PUBLIC || true;
cat > /tmp/ofeed-policy.json << 'EOF'
{
\"Version\": \"2012-10-17\",
\"Statement\": [
{
\"Action\": [\"s3:GetObject\", \"s3:PutObject\", \"s3:DeleteObject\"],
\"Effect\": \"Allow\",
\"Resource\": [\"arn:aws:s3:::$$S3_BUCKET_PUBLIC/*\"]
},
{
\"Action\": [\"s3:ListBucket\"],
\"Effect\": \"Allow\",
\"Resource\": [\"arn:aws:s3:::$$S3_BUCKET_PUBLIC\"]
}
]
}
EOF
mc admin policy create local ofeed-policy /tmp/ofeed-policy.json || true;
if [ -n \"$$S3_ACCESS_KEY\" ] && [ -n \"$$S3_SECRET_KEY\" ]; then
mc admin user add local $$S3_ACCESS_KEY $$S3_SECRET_KEY || true;
mc admin policy attach local ofeed-policy --user $$S3_ACCESS_KEY || true;
fi;
exit 0;
"
networks:
- app-network
volumes:
minio-data: