yaskm deployment

This commit is contained in:
Bryan Joshua Pedini 2024-08-17 16:09:13 +02:00
parent 0886c1b273
commit c0dfa37e36
4 changed files with 78 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.env
data
config.yml

11
config.yml.example Normal file
View File

@ -0,0 +1,11 @@
---
listen:
address: 0.0.0.0
port: 80
db:
host: mariadb
port: 3306
username: yaskm
password: P4ssw0rd!
database: yaskm

43
docker-compose.yml Normal file
View File

@ -0,0 +1,43 @@
---
services:
yaskm:
image: ${YASKM_REGISTRY}/yaskm:${YASKM_VERSION}
restart: unless-stopped
labels:
- traefik.enable=${TRAEFIK_ENABLED}
- traefik.docker.network=${TRAEFIK_NETWORK}
### Section HTTP
- traefik.http.routers.http-${TRAEFIK_ROUTER}.entrypoints=http
# redirect to HTTPS only
- traefik.http.routers.http-${TRAEFIK_ROUTER}.middlewares=http-to-https
- traefik.http.routers.http-${TRAEFIK_ROUTER}.rule=${TRAEFIK_MATCHRULE}
### Section HTTPS
- traefik.http.routers.https-${TRAEFIK_ROUTER}.entrypoints=https
# configure the exposed service
- traefik.http.routers.https-${TRAEFIK_ROUTER}.rule=${TRAEFIK_MATCHRULE}
# of course, enable TLS and it's certificate provider
- traefik.http.routers.https-${TRAEFIK_ROUTER}.tls=${TRAEFIK_TLSENABLED}
- traefik.http.routers.https-${TRAEFIK_ROUTER}.tls.certresolver=${TRAEFIK_CERTRESOLVER}
# specify a service so a custom port can be used
- traefik.http.services.${TRAEFIK_SERVICE}.loadbalancer.server.port=${TRAEFIK_SERVICE_PORT}
networks:
- internal
- traefik
volumes:
- ./config.yml:/config.yml
mariadb:
image: docker.io/mariadb:${MARIADB_VERSION}
restart: unless-stopped
environment:
- MARIADB_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD}
- MARIADB_USER=${MARIADB_USER}
- MARIADB_PASSWORD=${MARIADB_PASSWORD}
- MARIADB_DATABASE=${MARIADB_DATABASE}
volumes:
- ${MARIADB_DATA}:/var/lib/mysql
networks:
internal:
traefik:
external: true
name: ${TRAEFIK_NETWORK}

21
env.example Normal file
View File

@ -0,0 +1,21 @@
# Træfik
TRAEFIK_ENABLED=true
TRAEFIK_CERTRESOLVER=letsencrypt
TRAEFIK_NETWORK=traefik
TRAEFIK_MATCHRULE=Host(`yaskm.example.com`)
TRAEFIK_ROUTER=yaskm_example_com
TRAEFIK_SERVICE=yaskm_example_com
TRAEFIK_SERVICE_PORT=80
TRAEFIK_TLSENABLED=true
# YASKM
YASKM_REGISTRY=git.bjphoster.com/source
YASKM_VERSION=latest
# MariaDB
MARIADB_VERSION=latest
MARIADB_DATA=./data
MARIADB_ROOT_PASSWORD=r00t
MARIADB_DATABASE=yaskm
MARIADB_USER=yaskm
MARIADB_PASSWORD=P4ssw0rd!