diff --git a/docker-compose.yml b/docker-compose.yml index cf8e041..4adda2c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,33 @@ --- services: - app: + ferdium-server: + image: ferdium/ferdium-server:${FERDIUM_VERSION} 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: ### Section Træfik - traefik.enable=${TRAEFIK_ENABLED} @@ -22,15 +48,40 @@ services: # specify a service so a custom port can be used - traefik.http.services.${TRAEFIK_SERVICE}.loadbalancer.server.port=${TRAEFIK_SERVICE_PORT} ### Section Diun - - diun.enable=${DIUN_ENABLE} - - diun.watch_repo=${DIUN_WATCHREPO} - - diun.sort_tags=${DIUN_SORTALGO} - - diun.include_tags=${DIUN_INCLUDE} - - diun.exclude_tags=${DIUN_EXCLUDE} + - diun.enable=${FERDIUM_DIUN_ENABLE} + - diun.watch_repo=${FERDIUM_DIUN_WATCHREPO} + - diun.sort_tags=${FERDIUM_DIUN_SORTALGO} + - diun.include_tags=${FERDIUM_DIUN_INCLUDE} + - diun.exclude_tags=${FERDIUM_DIUN_EXCLUDE} networks: + - internal - 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: + internal: traefik: external: true name: ${TRAEFIK_NETWORK} diff --git a/env.example b/env.example index 263f7aa..efb8ae6 100644 --- a/env.example +++ b/env.example @@ -1,18 +1,54 @@ # Træfik TRAEFIK_ENABLED=true TRAEFIK_NETWORK=traefik -TRAEFIK_ROUTER=app_example_com -TRAEFIK_SERVICE=app_example_com -TRAEFIK_SERVICE_PORT=80 -TRAEFIK_MATCHRULE=Host(`app.example.com`) +TRAEFIK_ROUTER=ferdium_example_com +TRAEFIK_SERVICE=ferdium_example_com +TRAEFIK_SERVICE_PORT=3333 +TRAEFIK_MATCHRULE=Host(`ferdium.example.com`) TRAEFIK_TLSENABLED=true TRAEFIK_CERTRESOLVER=letsencrypt TRAEFIK_HTTP_MIDDLEWARES=http-to-https TRAEFIK_HTTPS_MIDDLEWARES=hsts -# Diun -DIUN_ENABLE=true -DIUN_WATCHREPO=true -DIUN_SORTALGO=semver -DIUN_INCLUDE= -DIUN_EXCLUDE= +# Diun Ferdium +FERDIUM_DIUN_ENABLE=true +FERDIUM_DIUN_WATCHREPO=true +FERDIUM_DIUN_SORTALGO=semver +FERDIUM_DIUN_INCLUDE= +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