-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
81 lines (78 loc) · 2.42 KB
/
Copy pathdocker-compose.yml
File metadata and controls
81 lines (78 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
services:
object-storage-api:
container_name: object-storage-api
build:
context: .
target: dev
volumes:
- ./object_storage_api:/app/object_storage_api
- ./keys/jwt-key.pub:/app/keys/jwt-key.pub
- ./logging.ini:/app/logging.ini
restart: on-failure
ports:
- 8002:8000
depends_on:
- mongo-db
- rustfs
env_file:
- path: ./.env
environment:
OS_DATABASE__HOST_AND_OPTIONS: object-storage-api-mongodb:27017/?authMechanism=SCRAM-SHA-256&authSource=admin
extra_hosts:
# Want to use localhost for RustFS connection so the presigned URLs are correct but also want to avoid using host
# networking
- "localhost:host-gateway"
mongo-db:
image: mongo:8.0-noble
container_name: object-storage-api-mongodb
entrypoint: mongodb_entrypoint.sh
volumes:
- ./mongodb/data:/data/db
- ./scripts/mongodb_entrypoint.sh:/usr/local/bin/mongodb_entrypoint.sh:ro
restart: always
ports:
- 27018:27017
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
# From https://github.com/rustfs/cli/blob/9797ffbfd0dc2ba9d35e4dd49a2dff1c11afd51f/docker/docker-compose.yml
rustfs:
image: rustfs/rustfs:1.0.0
container_name: object-storage-rustfs
volumes:
- ./rustfs/data:/data
restart: always
ports:
- "9000:9000" # S3 API
- "9001:9001" # Console
environment:
RUSTFS_ROOT_USER: root
RUSTFS_ROOT_PASSWORD: example_password
RUSTFS_ACCESS_KEY: root
RUSTFS_SECRET_KEY: example_password
RUSTFS_VOLUMES: /data
RUSTFS_ADDRESS: ":9000"
RUSTFS_CONSOLE_ENABLE: "true"
RUSTFS_CONSOLE_ADDRESS: ":9001"
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:9000/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
network_mode: "host"
rustfs-create-buckets:
image: rustfs/rc:v0.1.36
container_name: object-storage-rustfs-rc
depends_on:
rustfs:
condition: service_healthy
entrypoint: >
/bin/sh -c "
until (/usr/bin/rc alias set object-storage http://localhost:9000 root example_password) do echo '...waiting...' && sleep 1; done;
/usr/bin/rc mb object-storage/object-storage;
/usr/bin/rc mb object-storage/test-object-storage;
echo 'RustFS initialization complete';
exit 0;
"
network_mode: "host"