Compare commits

..

No commits in common. "development" and "production" have entirely different histories.

4 changed files with 12 additions and 132 deletions

View File

@ -1,17 +1,7 @@
--- ---
services: services:
guacamole: app:
image: guacamole/guacamole:${GUACAMOLE_VERSION}
restart: unless-stopped restart: unless-stopped
depends_on:
- guacd
- mariadb
environment:
- GUACD_HOSTNAME=guacd
- MYSQL_HOSTNAME=mariadb
- MYSQL_DATABASE=${MARIADB_NAME}
- MYSQL_USER=${MARIADB_USER}
- MYSQL_PASSWORD=${MARIADB_PASS}
labels: labels:
### Section Træfik ### Section Træfik
- traefik.enable=${TRAEFIK_ENABLED} - traefik.enable=${TRAEFIK_ENABLED}
@ -32,48 +22,15 @@ services:
# specify a service so a custom port can be used # specify a service so a custom port can be used
- traefik.http.services.${TRAEFIK_SERVICE}.loadbalancer.server.port=${TRAEFIK_SERVICE_PORT} - traefik.http.services.${TRAEFIK_SERVICE}.loadbalancer.server.port=${TRAEFIK_SERVICE_PORT}
### Section Diun ### Section Diun
- diun.enable=${DIUN_GUACAMOLE_ENABLE} - diun.enable=${DIUN_ENABLE}
- diun.watch_repo=${DIUN_GUACAMOLE_WATCHREPO} - diun.watch_repo=${DIUN_WATCHREPO}
- diun.sort_tags=${DIUN_GUACAMOLE_SORTALGO} - diun.sort_tags=${DIUN_SORTALGO}
- diun.include_tags=${DIUN_GUACAMOLE_INCLUDE} - diun.include_tags=${DIUN_INCLUDE}
- diun.exclude_tags=${DIUN_GUACAMOLE_EXCLUDE} - diun.exclude_tags=${DIUN_EXCLUDE}
networks: networks:
- internal
- traefik - traefik
guacd:
image: guacamole/guacd:${GUACD_VERSION}
restart: unless-stopped
labels:
### Section Diun
- diun.enable=${DIUN_GUACD_ENABLE}
- diun.watch_repo=${DIUN_GUACD_WATCHREPO}
- diun.sort_tags=${DIUN_GUACD_SORTALGO}
- diun.include_tags=${DIUN_GUACD_INCLUDE}
- diun.exclude_tags=${DIUN_GUACD_EXCLUDE}
networks:
- internal
mariadb:
image: mariadb:${MARIADB_VERSION}
restart: unless-stopped
environment:
- MARIADB_ROOT_PASSWORD=${MARIADB_ROOT}
- MARIADB_DATABASE=${MARIADB_NAME}
- MARIADB_USER=${MARIADB_USER}
- MARIADB_PASSWORD=${MARIADB_PASS}
labels:
### Section Diun
- diun.enable=${DIUN_MARIADB_ENABLE}
- diun.watch_repo=${DIUN_MARIADB_WATCHREPO}
- diun.sort_tags=${DIUN_MARIADB_SORTALGO}
- diun.include_tags=${DIUN_MARIADB_INCLUDE}
- diun.exclude_tags=${DIUN_MARIADB_EXCLUDE}
networks:
- internal
volumes:
- ${MARIADB_DATA}:/var/lib/mysql
networks: networks:
internal:
traefik: traefik:
external: true external: true
name: ${TRAEFIK_NETWORK} name: ${TRAEFIK_NETWORK}

View File

@ -3,7 +3,7 @@ TRAEFIK_ENABLED=true
TRAEFIK_NETWORK=traefik TRAEFIK_NETWORK=traefik
TRAEFIK_ROUTER=app_example_com TRAEFIK_ROUTER=app_example_com
TRAEFIK_SERVICE=app_example_com TRAEFIK_SERVICE=app_example_com
TRAEFIK_SERVICE_PORT=8080 TRAEFIK_SERVICE_PORT=80
TRAEFIK_MATCHRULE=Host(`app.example.com`) TRAEFIK_MATCHRULE=Host(`app.example.com`)
TRAEFIK_TLSENABLED=true TRAEFIK_TLSENABLED=true
TRAEFIK_CERTRESOLVER=letsencrypt TRAEFIK_CERTRESOLVER=letsencrypt
@ -11,32 +11,8 @@ TRAEFIK_HTTP_MIDDLEWARES=http-to-https
TRAEFIK_HTTPS_MIDDLEWARES=hsts TRAEFIK_HTTPS_MIDDLEWARES=hsts
# Diun # Diun
DIUN_GUACAMOLE_ENABLE=true DIUN_ENABLE=true
DIUN_GUACAMOLE_WATCHREPO=true DIUN_WATCHREPO=true
DIUN_GUACAMOLE_SORTALGO=semver DIUN_SORTALGO=semver
DIUN_GUACAMOLE_INCLUDE=([0-9]+)\.([0-9]+)\.([0-9]+) DIUN_INCLUDE=
DIUN_GUACAMOLE_EXCLUDE= DIUN_EXCLUDE=
DIUN_GUACD_ENABLE=true
DIUN_GUACD_WATCHREPO=true
DIUN_GUACD_SORTALGO=semver
DIUN_GUACD_INCLUDE=([0-9]+)\.([0-9]+)\.([0-9]+)
DIUN_GUACD_EXCLUDE=
DIUN_MARIADB_ENABLE=true
DIUN_MARIADB_WATCHREPO=true
DIUN_MARIADB_SORTALGO=semver
DIUN_MARIADB_INCLUDE=([0-9]+)\.([0-9]+)\.([0-9]+)
DIUN_MARIADB_EXCLUDE=
# Guacamole
GUACAMOLE_VERSION=1.4.0
# Guacd
GUACD_VERSION=1.4.0
# MariaDB
MARIADB_VERSION=10.9.3
MARIADB_DATA=./data/mariadb
MARIADB_ROOT=
MARIADB_NAME=guacamole
MARIADB_USER=guacamole
MARIADB_PASS=

37
init.sh
View File

@ -1,37 +0,0 @@
#!/usr/bin/env bash
set -e
WAIT_TIMEOUT=10
# Retrieve proper environment variables
GUACAMOLE_VERSION=$(cat .env | grep GUACAMOLE_VERSION | sed 's/GUACAMOLE_VERSION=//')
MARIADB_NAME=$(cat .env | grep MARIADB_NAME | sed 's/MARIADB_NAME=//')
# Pull the Guacamole image
docker pull guacamole/guacamole:"${GUACAMOLE_VERSION}"
# Generate initial database schema from Guacamole's image
docker run -it --rm \
guacamole/guacamole:"${GUACAMOLE_VERSION}" \
/opt/guacamole/bin/initdb.sh \
--mysql > initdb.sql
# Start the database instance
docker compose up -d mariadb
# Wait a couple of seconds that the database is ready
for I in $(eval echo "{$WAIT_TIMEOUT..1}"); do
printf " ${I}"
sleep 1
done
echo
# Initialize the database
docker compose exec \
--no-TTY -e MARIADB_NAME="${MARIADB_NAME}" mariadb \
sh -c 'exec mysql -uroot -p"$MARIADB_ROOT_PASSWORD" "$MARIADB_NAME"' < initdb.sql
# Remove the unnecessary database init file
rm -rf initdb.sql
# Stop & remove the database container for good measure
docker compose rm -fs mariadb

View File

@ -1,16 +0,0 @@
#!/usr/bin/env bash
set -e
WAIT_TIMEOUT=5
# Start the database instance
docker compose up -d mariadb
# Wait a couple of seconds that the database is ready
for I in $(eval echo "{$WAIT_TIMEOUT..1}"); do
printf " ${I}"
sleep 1
done
echo
# Start the rest of the containers
docker compose up -d