Deliver complete stack for nextcloud.

This commit is contained in:
2022-02-22 09:13:24 +01:00
parent b788fa12bc
commit 146d69e6fd
4 changed files with 53 additions and 38 deletions

4
.env
View File

@@ -1,8 +1,4 @@
DB_ROOT_PW=340985asdfklweo20350~
REDIS_PW=230skdfjl~23409
NEXTCLOUD_ADMIN_USER=chris
NEXTCLOUD_ADMIN_PW=lmaa,dw.
# InfluxDB options
INFLUXDB_DB=influx

View File

@@ -115,14 +115,3 @@ services:
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
redis:
image: redis:alpine
container_name: redis
restart: unless-stopped
volumes:
- redis-data:/data
networks:
- internal
healthcheck:
test: ["CMD-SHELL", "redis-cli ping"]

View File

@@ -7,40 +7,48 @@ volumes:
name: nextcloud-data
nextcloud-config:
name: nextcloud-config
nextcloud-db:
name: nextcloud-db
nextcloud-redis:
name: nextcloud-redis
networks:
proxy:
external: true
internal:
external: true
nextcloud:
name: nextcloud
external: false
services:
nextcloud:
image: nextcloud:22-fpm-alpine
container_name: nextcloud
hostname: nextcloud-web
restart: unless-stopped
volumes:
- nextcloud:/var/www/html
- nextcloud-data:/var/www/html/data
- nextcloud-config:/var/www/html/config
depends_on:
- nextcloud-db
- nextcloud-redis
networks:
- internal
env_file: ../.env
- nextcloud
environment:
- POSTGRES_DB:nextcloud
- POSTGRES_USER:nextcloud
- POSTGRES_PASSWORD:jX9hKI2POvt1VrjVbBs4
- POSTGRES_HOST:pgsql14
- REDIS_HOST:redis
- REDIS_HOST_PASSWORD:${REDIS_PW}
- NEXTCLOUD_ADMIN_USER:${NEXTCLOUD_ADMIN_USER}
- NEXTCLOUD_ADMIN_PASSWORD:${NEXTCLOUD_ADMIN_PW}
- NEXTCLOUD_TRUSTED_DOMAINS:cs-nextcloud.ddnss.de nextcloud.lan
- VIRTUAL_HOST:nextcloud
POSTGRES_PASSWORD: ${DB_PASS}
POSTGRES_USER: ${DB_USER}
POSTGRES_DB: ${DB_NAME}
POSTGRES_HOST: nextcloud-db:5432
REDIS_HOST: nextcloud-redis
NEXTCLOUD_ADMIN_USER: ${NEXTCLOUD_ADMIN_USER}
NEXTCLOUD_ADMIN_PASSWORD: ${NEXTCLOUD_ADMIN_PW}
NEXTCLOUD_TRUSTED_DOMAINS: cs-nextcloud.ddnss.de nextcloud.lan
VIRTUAL_HOST: nextcloud
nginx-nc:
nextcloud-web:
image: nginx:alpine
container_name: nginx-nc
container_name: nextcloud-web
hostname: nextcloud-web
restart: unless-stopped
labels:
- "traefik.enable=true"
@@ -61,12 +69,39 @@ services:
- "traefik.http.middlewares.nextcloud-redirect.redirectregex.permanent=true"
- "traefik.http.middlewares.nextcloud-redirect.redirectregex.regex=^https://(.*)/.well-known/(card|cal)dav"
- "traefik.http.middlewares.nextcloud-redirect.redirectregex.replacement=https://$${1}/remote.php/dav/"
depends_on:
- nextcloud
networks:
- proxy
- internal
- nextcloud
volumes:
- nextcloud:/var/www/html
- ${PWD}/nextcloud.conf:/etc/nginx/conf.d/default.conf
nextcloud-db:
image: postgres:14-alpine
container_name: nextcloud-db
hostname: naextcloud-db
restart: unless-stopped
volumes:
- nextcloud-db:/var/lib/postgresql/data
networks:
- nextcloud
environment:
POSTGRES_PASSWORD: ${DB_PASS}
POSTGRES_USER: ${DB_USER}
POSTGRES_DB: ${DB_NAME}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $DB_USER"]
nextcloud-redis:
image: redis:alpine
container_name: nextcloud-redis
hostname: nextcloud-redis
restart: unless-stopped
volumes:
- nextcloud-redis:/data
networks:
- nextcloud
healthcheck:
test: ["CMD-SHELL", "redis-cli ping"]

View File

@@ -1,14 +1,9 @@
-- create the databases;
CREATE DATABASE nextcloud;
CREATE DATABASE gitea;
CREATE DATABASE mattermost;
-- create users and privileges
CREATE USER nextcloud WITH PASSWORD 'jX9hKI2POvt1VrjVbBs4';
GRANT ALL PRIVILEGES ON DATABASE nextcloud TO nextcloud;
CREATE USER gitea WITH PASSWORD 'sadlkf0234lsdf';
GRANT ALL PRIVILEGES ON DATABASE gitea TO gitea;