-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
52 lines (48 loc) · 1.47 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
name: messageredir-stack
x-logging:
&default-logging
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
services:
messageredir:
build: .
image: alex3iii/messageredir:latest
container_name: messageredir-inst
environment:
- MREDIR_DB_FILE_NAME=${MREDIR_DB_FILE_NAME:-/root/app/db/messageredir.db}
- MREDIR_TG_BOT_TOKEN=${MREDIR_TG_BOT_TOKEN:-}
- MREDIR_USER_TOKEN_LENGTH=${MREDIR_USER_TOKEN_LENGTH:-}
- MREDIR_LOG_USER_MESSAGES=${MREDIR_LOG_USER_MESSAGES:-}
- MREDIR_TLS_CERT_FILE=${MREDIR_TLS_CERT_FILE:-}
- MREDIR_TLS_KEY_FILE=${MREDIR_TLS_KEY_FILE:-}
- MREDIR_MY_HOST=${MREDIR_MY_HOST:-}
volumes:
- messageredir-db:/root/app/db
- messageredir-tls:/root/app/tls
ports:
- 8089:8080
restart: unless-stopped
depends_on:
init-tls:
condition: service_completed_successfully
logging: *default-logging
init-tls:
image: alpine
container_name: init-tls-inst
volumes:
- messageredir-tls:/root/app/tls
command: >
sh -c "
if [ ! -f /root/app/tls/tls.key ] || [ ! -f /root/app/tls/tls.crt ]; then
apk add --no-cache openssl &&
mkdir -p /root/app/tls &&
openssl req -x509 -nodes -days 36500 -newkey rsa:2048 -keyout /root/app/tls/tls.key -out /root/app/tls/tls.crt -subj '/CN=localhost' &&
echo 'TLS certificate and key generated'
fi
"
restart: "no"
volumes:
messageredir-db:
messageredir-tls: