turned base to ferdium-server deployment

This commit is contained in:
Bryan Joshua Pedini 2023-11-19 19:18:24 +01:00
parent 5ed1af1f7f
commit c7c26f8f34
2 changed files with 103 additions and 16 deletions

View File

@ -1,7 +1,33 @@
--- ---
services: services:
app: ferdium-server:
image: ferdium/ferdium-server:${FERDIUM_VERSION}
restart: unless-stopped restart: unless-stopped
depends_on:
- mariadb
environment:
- NODE_ENV=${FERDIUM_NODEENV}
- APP_URL=${FERDIUM_URL}
- DB_CONNECTION=${FERDIUM_DATABASE}
- DB_HOST=${FERDIUM_DBHOST}
- DB_PORT=${FERDIUM_DBPORT}
- DB_USER=${MARIADB_USER}
- DB_PASSWORD=${MARIADB_PASSWORD}
- DB_DATABASE=${MARIADB_DATABASE}
- DB_SSL=${FERDIUM_DBSSL}
- MAIL_CONNECTION=${FERDIUM_MAIL}
- SMTP_HOST=${FERDIUM_MAILHOST}
- SMTP_PORT=${FERDIUM_MAILPORT}
- MAIL_SSL=${FERDIUM_MAILSSL}
- MAIL_USERNAME=${FERDIUM_MAILUSER}
- MAIL_PASSWORD=${FERDIUM_MAILPASS}
- MAIL_SENDER=${FERDIUM_MAILSENDER}
- IS_CREATION_ENABLED=${FERDIUM_RECIPESCREATION}
- IS_DASHBOARD_ENABLED=${FERDIUM_DASHBOARD}
- IS_REGISTRATION_ENABLED=${FERDIUM_REGISTRATION}
- CONNECT_WITH_FRANZ=${FERDIUM_FRANZ}
- DATA_DIR=/data
- JWT_USE_PEM=true
labels: labels:
### Section Træfik ### Section Træfik
- traefik.enable=${TRAEFIK_ENABLED} - traefik.enable=${TRAEFIK_ENABLED}
@ -22,15 +48,40 @@ 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_ENABLE} - diun.enable=${FERDIUM_DIUN_ENABLE}
- diun.watch_repo=${DIUN_WATCHREPO} - diun.watch_repo=${FERDIUM_DIUN_WATCHREPO}
- diun.sort_tags=${DIUN_SORTALGO} - diun.sort_tags=${FERDIUM_DIUN_SORTALGO}
- diun.include_tags=${DIUN_INCLUDE} - diun.include_tags=${FERDIUM_DIUN_INCLUDE}
- diun.exclude_tags=${DIUN_EXCLUDE} - diun.exclude_tags=${FERDIUM_DIUN_EXCLUDE}
networks: networks:
- internal
- traefik - traefik
volumes:
- ${FERDIUM_DATA}:/data
- ${FERDIUM_RECIPES}:/app/recipes
mariadb:
image: 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}
labels:
### Section Diun
- diun.enable=${MARIADB_DIUN_ENABLE}
- diun.watch_repo=${MARIADB_DIUN_WATCHREPO}
- diun.sort_tags=${MARIADB_DIUN_SORTALGO}
- diun.include_tags=${MARIADB_DIUN_INCLUDE}
- diun.exclude_tags=${MARIADB_DIUN_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

@ -1,18 +1,54 @@
# Træfik # Træfik
TRAEFIK_ENABLED=true TRAEFIK_ENABLED=true
TRAEFIK_NETWORK=traefik TRAEFIK_NETWORK=traefik
TRAEFIK_ROUTER=app_example_com TRAEFIK_ROUTER=ferdium_example_com
TRAEFIK_SERVICE=app_example_com TRAEFIK_SERVICE=ferdium_example_com
TRAEFIK_SERVICE_PORT=80 TRAEFIK_SERVICE_PORT=3333
TRAEFIK_MATCHRULE=Host(`app.example.com`) TRAEFIK_MATCHRULE=Host(`ferdium.example.com`)
TRAEFIK_TLSENABLED=true TRAEFIK_TLSENABLED=true
TRAEFIK_CERTRESOLVER=letsencrypt TRAEFIK_CERTRESOLVER=letsencrypt
TRAEFIK_HTTP_MIDDLEWARES=http-to-https TRAEFIK_HTTP_MIDDLEWARES=http-to-https
TRAEFIK_HTTPS_MIDDLEWARES=hsts TRAEFIK_HTTPS_MIDDLEWARES=hsts
# Diun # Diun Ferdium
DIUN_ENABLE=true FERDIUM_DIUN_ENABLE=true
DIUN_WATCHREPO=true FERDIUM_DIUN_WATCHREPO=true
DIUN_SORTALGO=semver FERDIUM_DIUN_SORTALGO=semver
DIUN_INCLUDE= FERDIUM_DIUN_INCLUDE=
DIUN_EXCLUDE= FERDIUM_DIUN_EXCLUDE=
# Diun MariaDB
MARIADB_DIUN_ENABLE=true
MARIADB_DIUN_WATCHREPO=true
MARIADB_DIUN_SORTALGO=semver
MARIADB_DIUN_INCLUDE=
MARIADB_DIUN_EXCLUDE=
# MariaDB
MARIADB_VERSION=11.1.3
MARIADB_DATA=./data/mariadb
MARIADB_ROOT_PASSWORD=r00tp4ssw0rd
MARIADB_DATABASE=ferdium
MARIADB_USER=ferdium
MARIADB_PASSWORD=p4ssw0rd
# Ferdium
FERDIUM_VERSION=2.0.3
FERDIUM_DATA=./data/ferdium
FERDIUM_RECIPES=./data/ferdium-recipes
FERDIUM_NODEENV=production
FERDIUM_URL=https://ferdium.example.com
FERDIUM_DATABASE=mysql
FERDIUM_DBHOST=mariadb
FERDIUM_DBPORT=3306
FERDIUM_DBSSL=false
FERDIUM_MAIL=smtp
FERDIUM_MAILHOST=127.0.0.1
FERDIUM_MAILPORT=2525
FERDIUM_MAILSSL=false
FERDIUM_MAILUSER=username
FERDIUM_MAILPASS=password
FERDIUM_MAILSENDER=noreply@ferdium.org
FERDIUM_RECIPESCREATION=true
FERDIUM_DASHBOARD=true
FERDIUM_REGISTRATION=true
FERDIUM_FRANZ=false