From 4efea72d64433ec83331fdb8eda82ea5b2f14398 Mon Sep 17 00:00:00 2001 From: EmaMaker Date: Mon, 3 Jan 2022 12:31:54 +0100 Subject: [PATCH] fix issue with docker networking declaration that resulted in services not connecting to each other --- docker_compose/gitea.yml | 13 ++++++------- docker_compose/nextcloud.yml | 15 ++++++++++----- docker_compose/nginx.yml | 8 +++++++- 3 files changed, 23 insertions(+), 13 deletions(-) mode change 100644 => 100755 docker_compose/nginx.yml diff --git a/docker_compose/gitea.yml b/docker_compose/gitea.yml index 5e695da..8a4b199 100644 --- a/docker_compose/gitea.yml +++ b/docker_compose/gitea.yml @@ -3,22 +3,21 @@ version: "3.3" services: server: image: gitea/gitea:latest - restart: always +# restart: always volumes: - $GITEA_DATADIR:/data - - $GITEA_CONFIGDIR:/etc/gitea - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro - - $CERTS_DIR/fullchain.pem:/var/lib/gitea/cert.pem - - $CERTS_DIR/privkey.pem:/var/lib/gitea/privkey.pem expose: - "3000" - "2222" environment: - - VIRTUAL_HOST=gitea.$LETSENCRYPT_DOMAIN + - VIRTUAL_HOST=git.emamaker.com - VIRTUAL_PORT=3000 - - LETSENCRYPT_HOST=gitea.$LETSENCRYPT_DOMAIN - - LETSENCRYPT_EMAIL=$LETSENCRYPT_EMAIL + - LETSENCRYPT_HOST=git.emamaker.com + - LETSENCRYPT_EMAIL=emamaker0@gmail.com + networks: + - default networks: default: diff --git a/docker_compose/nextcloud.yml b/docker_compose/nextcloud.yml index 4d5a033..f752c32 100644 --- a/docker_compose/nextcloud.yml +++ b/docker_compose/nextcloud.yml @@ -3,7 +3,7 @@ version: '2' services: db: image: mariadb:10.5 - restart: always +# restart: always command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW volumes: - $NEXTCLOUD_DB_DATADIR:/var/lib/mysql @@ -12,10 +12,12 @@ services: - MYSQL_PASSWORD=$NEXTCLOUD_MYSQL_PWD - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud + networks: + - default app: image: nextcloud:latest - restart: always +# restart: always expose: - "80" - "443" @@ -26,14 +28,17 @@ services: environment: # - NEXTCLOUD_ADMIN_USER=testuser #this is just for initial setup, and the user can be delete afterwards # - NEXTCLOUD_ADMIN_PASSWORD=test123 - - NEXTCLOUD_TRUSTED_DOMAINS=nextcloud.emamaker.com emamaker.com + - NEXTCLOUD_TRUSTED_DOMAINS=nextcloud.emamaker.com emamaker.com files.emamaker.com - MYSQL_PASSWORD=$NEXTCLOUD_MYSQL_PWD - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud - MYSQL_HOST=db - - VIRTUAL_HOST=nextcloud.$LETSENCRYPT_DOMAIN - - LETSENCRYPT_HOST=nextcloud.$LETSENCRYPT_DOMAIN + - VIRTUAL_HOST=files.$LETSENCRYPT_DOMAIN + - VIRTUAL_PORT=80 + - LETSENCRYPT_HOST=files.$LETSENCRYPT_DOMAIN - LETSENCRYPT_EMAIL=$LETSENCRYPT_EMAIL + networks: + - default networks: default: diff --git a/docker_compose/nginx.yml b/docker_compose/nginx.yml old mode 100644 new mode 100755 index 587b1bd..87b7f9d --- a/docker_compose/nginx.yml +++ b/docker_compose/nginx.yml @@ -14,7 +14,9 @@ services: - "/etc/nginx/conf.d" - "/etc/nginx/vhost.d" - "/usr/share/nginx/html" - - $CERTS_DIR:/etc/nginx/certs:ro" + - "$CERTS_DIR:/etc/nginx/certs:ro" + networks: + - default nginx-gen: restart: always @@ -26,6 +28,8 @@ services: volumes_from: - nginx entrypoint: /usr/local/bin/docker-gen -notify-sighup nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf + networks: + - default letsencrypt-nginx-proxy-companion: restart: always @@ -38,6 +42,8 @@ services: - "$CERTS_DIR:/etc/nginx/certs:rw" environment: - NGINX_DOCKER_GEN_CONTAINER=nginx-gen + networks: + - default networks: default: