-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
146 lines (137 loc) · 3.49 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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Base docker-compose file for aquarium
#
# Defines services for Aquarium, Krill, database, and S3. Uses Docker network
# address translation, and containers for MySQL, and the Minio S3 server.
#
# Initializes the database the first time MySQL is run from the database dump
# in data/mysql_init/dump.sql. If you want to use an alternative, replace this
# file.
#
# To reininitialize the database with the original or an alternative dump file,
# remove the data/db directory with
#
# sudo rm -rf data/db/*
#
# before running `docker-compose up`
# set environment variable EMAIL_SERVICE to AWS to use AWS SES
version: "3.5"
services:
app:
image: aquariumbio/aquarium:${AQUARIUM_VERSION}
command: ["production"]
environment:
DB_NAME: ${DB_NAME}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
S3_LOCAL: "yes"
S3_ACCESS_KEY_ID: ${S3_ID}
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY}
S3_REGION: ${S3_REGION}
SECRET_KEY_BASE: ${SECRET_KEY_BASE}
TZ: ${TIMEZONE}
volumes:
- public:/aquarium/public
- logs:/aquarium/log
- shared:/aquarium/shared
- ./config/instance.yml:/aquarium/config/instance.yml
networks:
- aquarium_net
expose:
- "3000"
depends_on:
- db
- s3
cap_add:
- NET_ADMIN
sysctls:
- net.ipv4.conf.all.route_localnet=1
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
TZ: ${TIMEZONE}
volumes:
- ./data/db:/var/lib/mysql
- ./data/mysql_init/dump.sql:/docker-entrypoint-initdb.d/dump.sql
networks:
- aquarium_net
krill:
image: aquariumbio/aquarium:${AQUARIUM_VERSION}
command: ["krill", "production"]
networks:
- aquarium_net
expose:
- "3500"
environment:
DB_NAME: ${DB_NAME}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
S3_LOCAL: "yes"
S3_ACCESS_KEY_ID: ${S3_ID}
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY}
S3_REGION: ${S3_REGION}
TZ: ${TIMEZONE}
depends_on:
- db
- app
cap_add:
- NET_ADMIN
sysctls:
- net.ipv4.conf.all.route_localnet=1
s3:
image: minio/minio:edge
volumes:
- ./data/s3/data:/data
- ./data/s3/config:/root/.minio
command: server /data
expose:
- "9000"
environment:
MINIO_ACCESS_KEY: ${S3_ID}
MINIO_SECRET_KEY: ${S3_SECRET_ACCESS_KEY}
MINIO_REGION: ${S3_REGION}
networks:
- aquarium_net
createbucket:
image: minio/mc:RELEASE.2020-11-25T23-04-07Z
depends_on:
- s3
entrypoint: >
/bin/sh -c "
while ! nc -z s3 9000; do
sleep 1;
done;
sleep 1;
/usr/bin/mc config host add aqminio http://s3:9000 ${S3_ID} ${S3_SECRET_ACCESS_KEY};
/usr/bin/mc mb --region ${S3_REGION} -p aqminio/images;
/usr/bin/mc policy set download aqminio/images;
exit 0;
"
networks:
- aquarium_net
web:
image: nginx:stable-alpine
ports:
- "${APP_PUBLIC_PORT}:80"
- "${S3_PUBLIC_PORT}:9000"
networks:
- aquarium_net
depends_on:
- app
- s3
- createbucket
volumes:
- public:/aquarium/public
- logs:/aquarium/log
- shared:/aquarium/shared
- ./config/nginx.production.conf:/etc/nginx/conf.d/default.conf:ro
networks:
aquarium_net:
volumes:
public:
logs:
shared: