-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
135 lines (130 loc) · 3.78 KB
/
docker-compose.yml
File metadata and controls
135 lines (130 loc) · 3.78 KB
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
version: '3.8'
services:
db:
image: mysql:9.0
container_name: guac-mysql
restart: unless-stopped
user: "1000:1000"
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
volumes:
- ./mysql-data:/var/lib/mysql
command: >
/bin/sh -c "
mkdir -p /var/lib/mysql &&
chown 1000:1000 /var/lib/mysql &&
chmod 770 /var/lib/mysql &&
docker-entrypoint.sh mysqld
"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD}"]
interval: 10s
timeout: 5s
retries: 15
start_period: 150s
logging:
driver: json-file
options:
max-size: ${LOG_MAX_SIZE:-10m}
max-file: ${LOG_MAX_FILE:-3}
networks:
- guac-net
guacd:
image: guacamole/guacd:1.6.0
container_name: guac-guacd
restart: unless-stopped
user: "1000:1000"
environment:
- GUACD_LOG_LEVEL=debug
volumes:
- ./recordings:/var/lib/guacamole/recordings
- ./recordings:/var/lib/guacamole/typescripts
command: >
/bin/sh -c "
mkdir -p /var/lib/guacamole/recordings /var/lib/guacamole/typescripts &&
chown 1000:1000 /var/lib/guacamole/recordings /var/lib/guacamole/typescripts &&
chmod 2775 /var/lib/guacamole/recordings /var/lib/guacamole/typescripts &&
/opt/guacamole/sbin/guacd -f
"
logging:
driver: json-file
options:
max-size: ${LOG_MAX_SIZE:-10m}
max-file: ${LOG_MAX_FILE:-3}
networks:
- guac-net
guacamole:
image: guacamole/guacamole:1.6.0
container_name: guac-guacamole
restart: unless-stopped
user: "999:1000"
environment:
- MYSQL_HOSTNAME=db
- MYSQL_PORT=${MYSQL_PORT:-3306}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- GUACD_HOSTNAME=guacd
- GUACD_PORT=${GUACD_PORT:-4822}
- REMOTE_IP_VALVE_ENABLED=true
- PROXY_ALLOWED_IPS_REGEX=^(10\.|172\.1[6789]\.|192\.168\.)
- RECORDING_ENABLED=true
- GUACAMOLE_RECORD_PATH=/var/lib/guacamole/recordings
- GUACAMOLE_TYPESCRIPT_PATH=/var/lib/guacamole/typescripts
volumes:
- ./recordings:/var/lib/guacamole/recordings
depends_on:
db:
condition: service_healthy
guacd:
condition: service_started
logging:
driver: json-file
options:
max-size: ${LOG_MAX_SIZE:-10m}
max-file: ${LOG_MAX_FILE:-3}
networks:
- guac-net
nginx:
image: nginx:1.28
container_name: guac-nginx
restart: unless-stopped
ports:
- "${HTTP_PORT:-8080}:80"
- "${HTTPS_PORT:-8443}:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx-certs:/etc/nginx/certs
command: >
/bin/sh -c "
mkdir -p /etc/nginx/certs &&
chown root:root /etc/nginx/certs &&
chmod 755 /etc/nginx/certs &&
rm -f /etc/nginx/conf.d/* &&
if [ ! -f /etc/nginx/certs/server.crt ] || [ ! -f /etc/nginx/certs/server.key ]; then
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout /etc/nginx/certs/server.key \
-out /etc/nginx/certs/server.crt \
-subj '/C=US/ST=State/L=City/O=Org/CN=${SERVER_NAME:-localhost}';
echo 'Certificates generated';
else
echo 'Certificates already exist';
fi &&
nginx -g 'daemon off;'
"
depends_on:
- guacamole
logging:
driver: json-file
options:
max-size: ${LOG_MAX_SIZE:-10m}
max-file: ${LOG_MAX_FILE:-3}
networks:
- guac-net
networks:
guac-net:
name: guac-net
driver: bridge