forked from TinkerersLabPREC/CargoStacks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
72 lines (68 loc) · 1.97 KB
/
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
version: "2.29.3"
services:
app:
build:
context: .
ports:
- "8080:8080"
restart: always
environment:
DATASOURCE_HOSTNAME: mysqldb
DATASOURCE_PORT: 3306
DATASOURCE_USERNAME: CargoStacks
DATASOURCE_PASSWORD: changeMe
DATASOURCE_DBNAME: CargoStacks
JPA_SHOW_SQL: true
JPA_HIBERNATE_DDL_AUTO: update
UPLOAD_PATH: /opt/repository
MAX_FILE_SIZE: 20MB
MAX_REQUEST_SIZE: 20MB
BCRYPT_PASSWORD_ENCODER_STRENGTH: 10
depends_on:
- mysqldb
networks:
- CargoStacks-net
cert-gen:
image: alpine
volumes:
- ./certs:/certs
entrypoint:
- /bin/sh
- -c
- apk add --no-cache openssl &&
openssl genpkey -algorithm RSA -out /certs/mysql.key -pkeyopt rsa_keygen_bits:2048 &&
openssl req -new -key /certs/mysql.key -out /certs/mysql.csr -subj "/CN=mysql/O=myorg/C=US" &&
openssl x509 -req -in /certs/mysql.csr -signkey /certs/mysql.key -out /certs/mysql.crt -days 365 &&
openssl genpkey -algorithm RSA -out /certs/ca.key -pkeyopt rsa_keygen_bits:2048 &&
openssl req -new -x509 -key /certs/ca.key -out /certs/ca.crt -days 1095 -subj "/CN=Certificate Authority/O=myorg/C=US" &&
chmod 600 /certs/* && chown 999:999 /certs/*
restart: "no"
networks:
- CargoStacks-net
mysqldb:
image: mariadb:latest
expose:
- 3306
ports:
- 3307:3306
volumes:
- ./mysql:/var/lib/mysql
- ./data:/var/lib/mysql
- ./certs:/etc/mysql/certs
command:
- --ssl-ca=/etc/mysql/certs/ca.crt
- --ssl-cert=/etc/mysql/certs/mysql.crt
- --ssl-key=/etc/mysql/certs/mysql.key
- --ssl=1
- --bind-address=0.0.0.0
environment:
MYSQL_ROOT_USERNAME: changeMe
MYSQL_ROOT_PASSWORD: changeMe
MYSQL_DATABASE: CargoStacks
MYSQL_USER: CargoStacks
MYSQL_PASSWORD: changeMe
networks:
- CargoStacks-net
networks:
CargoStacks-net:
driver: bridge