generated from shuntaka9576/python-project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
53 lines (53 loc) · 1.26 KB
/
docker-compose.yml
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
version: '3.6'
services:
# Main server
main:
build: .
networks:
- local-net
ports:
- ${PORT_AUDIO}:8000
environment:
- S3_ENDPOINT
- S3_BUCKET
- S3_REGION
- S3_KEY
- S3_SECRET
depends_on:
- minio
# Local S3 with web console (Optional)
minio:
image: minio/minio
volumes:
- ${VOLUME_MINIO_PATH}:/${S3_BUCKET}
ports:
- ${PORT_MINIO}:9000
- ${PORT_MINIO_CONSOLE}:9001
environment:
MINIO_ACCESS_KEY: ${S3_KEY}
MINIO_SECRET_KEY: ${S3_SECRET}
command: ["server", "--console-address", ":9001", "${S3_BUCKET}"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
networks:
- local-net
# Local S3 initialization script (Optional)
createbuckets:
image: minio/mc
depends_on:
- minio
entrypoint: >
/bin/sh -c "
until (/usr/bin/mc config host add myminio http://minio:9000 ${S3_KEY} ${S3_SECRET}) do echo '...waiting...' && sleep 1; done;
/usr/bin/mc mb myminio/${S3_BUCKET};
/usr/bin/mc policy download myminio/${S3_BUCKET};
exit 0;
"
networks:
- local-net
networks:
local-net:
driver: bridge