Improved Nextcloud config

pull/10/head
Jef Roosens 2021-04-23 15:02:42 +02:00
parent 4a4437683e
commit 0b85900b71
Signed by: Jef Roosens
GPG Key ID: B580B976584B5F30
3 changed files with 30 additions and 22 deletions

View File

@ -1,4 +1,4 @@
version: '2.8' version: '2.4'
services: services:
app: app:

View File

@ -2,7 +2,7 @@
POSTGRES_HOST=db POSTGRES_HOST=db
POSTGRES_DB=nextcloud POSTGRES_DB=nextcloud
POSTGRES_USER=nextcloud POSTGRES_USER=nextcloud
POSTGRES_PASSWORD=pass POSTGRES_PASSWORD=nextcloud
# Redis # Redis
REDIS_HOST=redis REDIS_HOST=redis

View File

@ -1,17 +1,24 @@
version: '3.5' version: '2.4'
services: services:
app: app:
image: 'nextcloud:20-apache' image: 'nextcloud:21.0.1-apache'
restart: 'always' restart: 'always'
healthcheck:
test: 'curl -f localhost || exit 1'
interval: '1m'
timeout: '10s'
retries: 3
start_period: '10s'
depends_on: depends_on:
- 'db' db:
- 'redis' condition: 'service_healthy'
redis:
condition: 'service_healthy'
env_file: env_file:
- '.env' - '.env'
labels:
- 'com.centurylinklabs.watchtower.enable=true'
networks: networks:
- 'default' - 'default'
- 'nginx' - 'nginx'
@ -21,40 +28,41 @@ services:
- 'root:/var/www/html' - 'root:/var/www/html'
cron: cron:
image: 'nextcloud:20-apache' image: 'nextcloud:21.0.1-apache'
entrypoint: '/cron.sh'
restart: 'always' restart: 'always'
entrypoint: '/cron.sh'
depends_on: depends_on:
- 'app' app:
condition: 'service_healthy'
env_file: env_file:
- '.env' - '.env'
labels:
- 'com.centurylinklabs.watchtower.enable=true'
volumes: volumes:
- 'config:/var/www/html/config' - 'config:/var/www/html/config'
- 'data:/var/www/html/data' - 'data:/var/www/html/data'
- 'root:/var/www/html' - 'root:/var/www/html'
db: db:
image: 'postgres:13-alpine' image: 'postgres:13.2-alpine'
restart: 'always' restart: 'always'
environment: environment:
- 'POSTGRES_DB' - 'POSTGRES_DB=nextcloud'
- 'POSTGRES_USER' - 'POSTGRES_USER=nextcloud'
- 'POSTGRES_PASSWORD' - 'POSTGRES_PASSWORD=nextcloud'
labels:
- 'com.centurylinklabs.watchtower.enable=true'
volumes: volumes:
- 'db-data:/var/lib/postgresql/data' - 'db-data:/var/lib/postgresql/data'
redis: redis:
image: 'redis:6-alpine' image: 'redis:6.0.12-alpine'
restart: 'always' restart: 'always'
labels: healthcheck:
- 'com.centurylinklabs.watchtower.enable=true' test: 'redis-cli -h localhost ping'
interval: '10s'
timeout: '5s'
retries: 3
networks: networks:
nginx: nginx: