-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
95 lines (90 loc) · 2.35 KB
/
docker-compose.yml
File metadata and controls
95 lines (90 loc) · 2.35 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
version: '3.8'
services:
# MinIO 对象存储服务
minio:
image: minio/minio:latest
container_name: s3proxy-minio
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
command: server /data --console-address ":9001"
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
# S3 Proxy 应用服务 (使用 H2 数据库)
s3-proxy:
image: chenmins/s3-proxy-java:latest
container_name: s3proxy-app
ports:
- "8080:8080"
environment:
- SPRING_PROFILES_ACTIVE=h2
- MINIO_ENDPOINT=http://minio:9000
- MINIO_ACCESS_KEY=minioadmin
- MINIO_SECRET_KEY=minioadmin
- MINIO_DEDUPE_BUCKET=dedupe-storage
- S3_AUTH_ENABLED=true
depends_on:
minio:
condition: service_healthy
restart: unless-stopped
volumes:
- s3proxy_data:/app/data
# MySQL 数据库服务(可选)
mysql:
image: mysql:8.0
container_name: s3proxy-mysql
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: s3proxy
MYSQL_USER: s3proxy
MYSQL_PASSWORD: s3proxypassword
volumes:
- mysql_data:/var/lib/mysql
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 30s
timeout: 10s
retries: 5
profiles:
- mysql
# S3 Proxy 应用服务 (使用 MySQL 数据库)
s3-proxy-mysql:
image: chenmins/s3-proxy-java:latest
container_name: s3proxy-app-mysql
ports:
- "8081:8080"
environment:
- SPRING_PROFILES_ACTIVE=mysql
- MYSQL_HOST=mysql
- MYSQL_PORT=3306
- MYSQL_DB=s3proxy
- MYSQL_USERNAME=s3proxy
- MYSQL_PASSWORD=s3proxypassword
- MINIO_ENDPOINT=http://minio:9000
- MINIO_ACCESS_KEY=minioadmin
- MINIO_SECRET_KEY=minioadmin
- MINIO_DEDUPE_BUCKET=dedupe-storage
- S3_AUTH_ENABLED=true
depends_on:
minio:
condition: service_healthy
mysql:
condition: service_healthy
restart: unless-stopped
profiles:
- mysql
volumes:
minio_data:
mysql_data:
s3proxy_data: