From 25c099b409b0adf8b581be9051df53a2612d3708 Mon Sep 17 00:00:00 2001 From: Simon C Date: Fri, 23 Jul 2021 15:29:23 +0200 Subject: [PATCH] refactor(HedgeDoc): Used empty docker-compose on url folder to simplify --- examples/hedgedoc.exemple.fr/.env | 34 +++++++++++++++++++ .../hedgedoc.exemple.fr/docker-compose.yml | 5 +++ hedgedoc/docker-compose.traefik.yml | 13 +++++++ hedgedoc/docker-compose.yml | 9 ++--- 4 files changed, 54 insertions(+), 7 deletions(-) create mode 100644 examples/hedgedoc.exemple.fr/.env create mode 100644 examples/hedgedoc.exemple.fr/docker-compose.yml create mode 100644 hedgedoc/docker-compose.traefik.yml diff --git a/examples/hedgedoc.exemple.fr/.env b/examples/hedgedoc.exemple.fr/.env new file mode 100644 index 0000000..3e58f68 --- /dev/null +++ b/examples/hedgedoc.exemple.fr/.env @@ -0,0 +1,34 @@ +######## +# DOCKER + +COMPOSE_FILE=./docker-compose.yml:../../hedgedoc/docker-compose.yml:../../hedgedoc/docker-compose.traefik.yml:../../postgres/docker-compose.yml +#DOCKER_HOST= + +########## +# HEDGEDOC + +HEDGEDOC_DOMAIN=hedgedoc.exemple.fr +HEDGEDOC_VOLUME_NAME=hedgedoc_exemple_fr_hedgedoc +HEDGEDOC_CONTAINER_NAME=hedgedoc_exemple_fr_hedgedoc +#HEDGEDOC_IMAGE= +#NODE_ENV= +#CMD_PROTOCOL_USESSL= +#CMD_ALLOW_GRAVATAR= +#CMD_ALLOW_FREEURL= +#CMD_ALLOW_EMAIL_REGISTER= + +########## +# POSTGRES + +POSTGRES_USER=user +POSTGRES_PASSWORD=password +POSTGRES_DB=database +POSTGRES_VOLUME_NAME=hedgedoc_exemple_fr_postgres +POSTGRES_CONTAINER_NAME=hedgedoc_exemple_fr_postgres +#POSTGRES_IMAGE= + +######### +# TRAEFIK + +#TRAEFIK_NETWORK_NAME= +#TRAEFIK_ROUTER_NAME=hedgedoc_exemple_fr # Don't use char '.' diff --git a/examples/hedgedoc.exemple.fr/docker-compose.yml b/examples/hedgedoc.exemple.fr/docker-compose.yml new file mode 100644 index 0000000..ed81f26 --- /dev/null +++ b/examples/hedgedoc.exemple.fr/docker-compose.yml @@ -0,0 +1,5 @@ +version: "3.8" + +# Ce fichier même vide est important puisqu'il permet de configurer la racine du +# lancement de docker-compose. Il est possible de venir surcharger le template +# utilisé diff --git a/hedgedoc/docker-compose.traefik.yml b/hedgedoc/docker-compose.traefik.yml new file mode 100644 index 0000000..36ec09a --- /dev/null +++ b/hedgedoc/docker-compose.traefik.yml @@ -0,0 +1,13 @@ +version: "3.8" + +networks: + default: + name: ${TRAEFIK_NETWORK_NAME:-traefik} + +services: + hedgedoc: + labels: + - traefik.enable=true + - traefik.docker.network=${TRAEFIK_NETWORK_NAME:-traefik} + - traefik.http.routers.${TRAEFIK_ROUTER_NAME:-hedgedoc}.rule=Host(`${HEDGEDOC_DOMAIN:?err}`) + - traefik.http.routers.${TRAEFIK_ROUTER_NAME:-hedgedoc}.entrypoints=web diff --git a/hedgedoc/docker-compose.yml b/hedgedoc/docker-compose.yml index cb82d71..c7dd5f2 100644 --- a/hedgedoc/docker-compose.yml +++ b/hedgedoc/docker-compose.yml @@ -9,8 +9,8 @@ services: container_name: ${HEDGEDOC_CONTAINER_NAME:-hedgedoc} image: ${HEDGEDOC_IMAGE:-linuxserver/hedgedoc:1.8.2-ls22} restart: always - # depends_on: # It's commented because docker `extends` don't support it - # - postgres + depends_on: + - postgres volumes: - hedgedoc:/config - /etc/timezone:/etc/timezone:ro @@ -24,8 +24,3 @@ services: CMD_ALLOW_GRAVATAR: ${CMD_ALLOW_GRAVATAR:-true} CMD_ALLOW_FREEURL: ${CMD_ALLOW_FREEURL:-false} CMD_ALLOW_EMAIL_REGISTER: ${CMD_ALLOW_EMAIL_REGISTER:-true} - labels: - - traefik.enable=true - - traefik.docker.network=${TRAEFIK_NETWORK_NAME:-traefik} - - traefik.http.routers.${TRAEFIK_ROUTER_NAME:-hedgedoc}.rule=Host(`${HEDGEDOC_DOMAIN:?err}`) - - traefik.http.routers.${TRAEFIK_ROUTER_NAME:-hedgedoc}.entrypoints=web