remove nginx proxy

add networks for connecting to reverse proxy
This commit is contained in:
James 2022-02-08 18:14:51 +00:00
parent 29a86b1923
commit 4c21dc9718
2 changed files with 17 additions and 22 deletions

View File

@ -1,15 +1,9 @@
# volume # docker
VOLUME_PATH=/data/nextcloud VOLUME_PATH=/data/nextcloud
DOCKER_PROXY_NETWORK=proxy
# nextcloud # nextcloud
NEXTCLOUD_TAG=23-apache NEXTCLOUD_TAG=23-apache
# postgres # postgres
POSTGRES_TAG=14 POSTGRES_TAG=14
# nginx
NGINX_HOST=localhost # REPLACE
NGINX_HTTP_PORT=80
NGINX_HTTPS_PORT=443
SSL_CERT_PATH=/etc/ssl/certs/ssl-cert-snakeoil.pem # REPLACE
SSL_KEY_PATH=/etc/ssl/private/ssl-cert-snakeoil.key # REPLACE

View File

@ -10,6 +10,12 @@ secrets:
nextcloud_admin_password: nextcloud_admin_password:
file: ./secrets/nextcloud_admin_password.txt file: ./secrets/nextcloud_admin_password.txt
networks:
frontend:
external: true
name: ${DOCKER_PROXY_NETWORK}
backend:
services: services:
db: db:
image: postgres:${POSTGRES_TAG} image: postgres:${POSTGRES_TAG}
@ -20,6 +26,8 @@ services:
- postgres_db - postgres_db
- postgres_user - postgres_user
- postgres_password - postgres_password
networks:
- backend
environment: environment:
POSTGRES_DB_FILE: /run/secrets/postgres_db POSTGRES_DB_FILE: /run/secrets/postgres_db
POSTGRES_USER_FILE: /run/secrets/postgres_user POSTGRES_USER_FILE: /run/secrets/postgres_user
@ -28,6 +36,8 @@ services:
redis: redis:
image: redis:alpine image: redis:alpine
restart: unless-stopped restart: unless-stopped
networks:
- backend
nextcloud: nextcloud:
build: build:
@ -43,6 +53,9 @@ services:
- postgres_password - postgres_password
- nextcloud_admin_user - nextcloud_admin_user
- nextcloud_admin_password - nextcloud_admin_password
networks:
- frontend
- backend
environment: environment:
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
POSTGRES_DB_FILE: /run/secrets/postgres_db POSTGRES_DB_FILE: /run/secrets/postgres_db
@ -57,25 +70,13 @@ services:
- db - db
- redis - redis
nginx:
build: nginx
restart: unless-stopped
ports:
- ${NGINX_HTTP_PORT}:80
- ${NGINX_HTTPS_PORT}:443
volumes:
- ${SSL_CERT_PATH}:/etc/ssl/certs/server.cert.pem:ro
- ${SSL_KEY_PATH}:/etc/ssl/private/server.key.pem:ro
environment:
NGINX_HOST: ${NGINX_HOST}
depends_on:
- nextcloud
cron: cron:
image: nextcloud:${NEXTCLOUD_TAG} image: nextcloud:${NEXTCLOUD_TAG}
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- ${VOLUME_PATH}/var/www/html:/var/www/html - ${VOLUME_PATH}/var/www/html:/var/www/html
networks:
- backend
entrypoint: /cron.sh entrypoint: /cron.sh
depends_on: depends_on:
- db - db