generated from shuntaka9576/python-project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yaml
131 lines (131 loc) · 3.38 KB
/
docker-compose.yaml
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
version: '3.6'
services:
# Main API (Required)
service:
container_name: sonolus_fastapi_service
hostname: sonolus_fastapi_service
build:
context: .
volumes:
- ${VOLUME_API_PATH}:/var/lib/mysql:delegated
ports:
- ${PORT_API}:8080
networks:
- local-net
depends_on:
- database
# SUS convertion server (Required)
# Run at sonolus_sus_service:3000
sus:
image: dosugamea/sonolus-sus-server:latest
container_name: sonolus_sus_service
hostname: sonolus_sus_service
networks:
- local-net
depends_on:
- service
ports:
- ${PORT_SUS}:3000
environment:
S3_KEY: ${S3_KEY}
S3_SECRET: ${S3_SECRET}
S3_BUCKET: ${S3_BUCKET}
S3_ENDPOINT: ${S3_ENDPOINT}
S3_REGION: ${S3_REGION}
# Image processing server (Required)
# Run at sonolus_image_service:8000
image:
image: sevenc7c/sonolus-image-server:latest
container_name: sonolus_image_service
hostname: sonolus_image_service
networks:
- local-net
depends_on:
- service
ports:
- ${PORT_IMAGE}:8000
environment:
S3_KEY: ${S3_KEY}
S3_SECRET: ${S3_SECRET}
S3_BUCKET: ${S3_BUCKET}
S3_ENDPOINT: ${S3_ENDPOINT}
S3_REGION: ${S3_REGION}
# MariaDB Database (Required)
database:
container_name: sonolus_fastapi_database
hostname: sonolus_fastapi_database
image: mariadb
restart: always
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci
volumes:
- ${VOLUME_DB_PATH}:/var/lib/mysql:delegated
ports:
- ${PORT_DB}:3306
networks:
- local-net
environment:
- MYSQL_ROOT_Host='%'
- MYSQL_ROOT_PASSWORD=${DB_ROOT}
- MYSQL_DATABASE=${DB_NAME}
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PASS}
- TZ='Asia/Tokyo'
# Database web console (Optional)
adminer:
image: adminer:latest
container_name: sonolus_fastapi_adminer
hostname: sonolus_fastapi_adminer
restart: always
ports:
- ${PORT_ADMINER}:8080
networks:
- local-net
depends_on:
- database
# 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
# Firebase auth emulator for development (Optional)
firebase:
image: andreysenov/firebase-tools:latest
command: firebase emulators:start
volumes:
- ./:/home/node
ports:
- ${PORT_FIREBASE_EMULATOR}:4000
- 9099:9099
networks:
- local-net
networks:
local-net:
driver: bridge