From 2e301760f487197ae8ee44b94b994ea96c1f233a Mon Sep 17 00:00:00 2001 From: Florian Schroen Date: Sat, 6 Jan 2024 18:54:21 +0100 Subject: [PATCH] rename docker-compose files and remove unused network "app" the default docker compose file should be minimal and easy to read as docker-compose.yml other docker-compose variants for typical setup should be named as: docker-compose..yml this way one could use e.g. `docker compose -f docker-compose.traefik.yml up` to start the variant for traefik. (mind keeping the file extension) and fixed a typo the README.md --- README.md | 6 ++++- docker-compose-no-traefik | 47 -------------------------------------- docker-compose.traefik.yml | 46 +++++++++++++++++++++++++++++++++++++ docker-compose.yml | 22 ------------------ 4 files changed, 51 insertions(+), 70 deletions(-) delete mode 100644 docker-compose-no-traefik create mode 100644 docker-compose.traefik.yml diff --git a/README.md b/README.md index 8a6a41d..c5b7287 100644 --- a/README.md +++ b/README.md @@ -50,5 +50,9 @@ docker compose build - run ``` -docker compose build +docker compose up + +# or variant with traefik labels: + +docker compose -f docker-compose.traefik.yml up ``` diff --git a/docker-compose-no-traefik b/docker-compose-no-traefik deleted file mode 100644 index 6390052..0000000 --- a/docker-compose-no-traefik +++ /dev/null @@ -1,47 +0,0 @@ ---- -version: "3.4" - -services: - app: - image: hargata/lubelog:latest - build: . - restart: unless-stopped - # volumes used to keep data persistent - volumes: - - config:/App/config - - data:/App/data - - documents:/App/wwwroot/documents - - images:/App/wwwroot/images - - log:/App/log - # expose port and/or use serving via traefik - ports: - - 8080:8080 - # traefik configurations, including networks can be commented out if not needed - # networks: - # - traefik-ingress - # labels: - # ## Traefik General - # # We set 'enable by default' to false, so this tells Traefik we want it to connect here - # traefik.enable: true - # # define network for traefik<>app communication - # traefik.docker.network: traefik-ingress - # ## HTTP Routers - # traefik.http.routers.whoami.entrypoints: https - # traefik.http.routers.whoami.rule: Host(`lubelog.mydomain.tld`) - # ## Middlewares - # #traefik.http.routers.whoami.middlewares: authentik@docker - # # none - # ## HTTP Services - # traefik.http.services.whoami.loadbalancer.server.port: 5000 - -volumes: - config: - data: - documents: - images: - log: - -#networks: -# app: -# traefik-ingress: -# external: true diff --git a/docker-compose.traefik.yml b/docker-compose.traefik.yml new file mode 100644 index 0000000..1dc2489 --- /dev/null +++ b/docker-compose.traefik.yml @@ -0,0 +1,46 @@ +--- +version: "3.4" + +services: + app: + image: hargata/lubelog:latest + build: . + restart: unless-stopped + # volumes used to keep data persistent + volumes: + - config:/App/config + - data:/App/data + - documents:/App/wwwroot/documents + - images:/App/wwwroot/images + - log:/App/log + # expose port and/or use serving via traefik + ports: + - 8080:8080 + # traefik configurations, including networks can be commented out if not needed + networks: + - traefik-ingress + labels: + ## Traefik General + # We set 'enable by default' to false, so this tells Traefik we want it to connect here + traefik.enable: true + # define network for traefik<>app communication + traefik.docker.network: traefik-ingress + ## HTTP Routers + traefik.http.routers.whoami.entrypoints: https + traefik.http.routers.whoami.rule: Host(`lubelog.mydomain.tld`) + ## Middlewares + #traefik.http.routers.whoami.middlewares: authentik@docker + # none + ## HTTP Services + traefik.http.services.whoami.loadbalancer.server.port: 5000 + +volumes: + config: + data: + documents: + images: + log: + +networks: + traefik-ingress: + external: true diff --git a/docker-compose.yml b/docker-compose.yml index 19010b8..aea0f00 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,23 +16,6 @@ services: # expose port and/or use serving via traefik ports: - 8080:8080 - # traefik configurations, including networks can be commented out if not needed - networks: - - traefik-ingress - labels: - ## Traefik General - # We set 'enable by default' to false, so this tells Traefik we want it to connect here - traefik.enable: true - # define network for traefik<>app communication - traefik.docker.network: traefik-ingress - ## HTTP Routers - traefik.http.routers.whoami.entrypoints: https - traefik.http.routers.whoami.rule: Host(`lubelog.mydomain.tld`) - ## Middlewares - #traefik.http.routers.whoami.middlewares: authentik@docker - # none - ## HTTP Services - traefik.http.services.whoami.loadbalancer.server.port: 5000 volumes: config: @@ -40,8 +23,3 @@ volumes: documents: images: log: - -networks: - app: - traefik-ingress: - external: true