nextcloud-compose.yml
· 1.7 KiB · YAML
Raw
services:
postgres:
image: postgres:17-alpine
restart: always
volumes:
- ./postgres:/var/lib/postgresql/data
environment:
- POSTGRES_DB=nextcloud
- POSTGRES_USER=nextcloud
- POSTGRES_PASSWORD=XYS22mtSXE5BSP9icaPxFZqw
networks:
- nextcloud-net
healthcheck: # Prüft, ob die DB wirklich bereit ist
test: ["CMD-SHELL", "pg_isready -U nextcloud"]
interval: 10s
timeout: 5s
retries: 5
valkey:
image: valkey/valkey:8-alpine
restart: always
mem_limit: 2g
command: valkey-server --requirepass 6dfK8X6upA4LmSerMlp11YKW --appendonly yes
environment:
- REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL
volumes:
- ./valkey:/data
networks:
- nextcloud-net
app:
container_name: nextcloud
image: nextcloud:32
restart: unless-stopped
mem_limit: 4g
ports:
- 8080:80
depends_on:
postgres:
condition: service_healthy # Wartet, bis DB wirklich bereit ist
valkey:
condition: service_started
volumes:
- ./nextcloud-data:/var/www/html
environment:
- POSTGRES_HOST=postgres
- POSTGRES_DB=nextcloud
- POSTGRES_USER=nextcloud
- POSTGRES_PASSWORD=XYS22mtSXE5BSP9icaPxFZqw
- REDIS_HOST=valkey
- REDIS_HOST_PASSWORD=6dfK8X6upA4LmSerMlp11YKW
networks:
- nextcloud-net
cron:
image: nextcloud:32
container_name: nextcloud-cron
restart: always
mem_limit: 4g
volumes:
- ./nextcloud-data:/var/www/html
entrypoint: /cron.sh
depends_on:
- postgres
- valkey
networks:
- nextcloud-net
networks:
nextcloud-net:
driver: bridge
| 1 | services: |
| 2 | postgres: |
| 3 | image: postgres:17-alpine |
| 4 | restart: always |
| 5 | volumes: |
| 6 | - ./postgres:/var/lib/postgresql/data |
| 7 | environment: |
| 8 | - POSTGRES_DB=nextcloud |
| 9 | - POSTGRES_USER=nextcloud |
| 10 | - POSTGRES_PASSWORD=XYS22mtSXE5BSP9icaPxFZqw |
| 11 | networks: |
| 12 | - nextcloud-net |
| 13 | healthcheck: # Prüft, ob die DB wirklich bereit ist |
| 14 | test: ["CMD-SHELL", "pg_isready -U nextcloud"] |
| 15 | interval: 10s |
| 16 | timeout: 5s |
| 17 | retries: 5 |
| 18 | |
| 19 | valkey: |
| 20 | image: valkey/valkey:8-alpine |
| 21 | restart: always |
| 22 | mem_limit: 2g |
| 23 | command: valkey-server --requirepass 6dfK8X6upA4LmSerMlp11YKW --appendonly yes |
| 24 | environment: |
| 25 | - REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL |
| 26 | volumes: |
| 27 | - ./valkey:/data |
| 28 | networks: |
| 29 | - nextcloud-net |
| 30 | |
| 31 | app: |
| 32 | container_name: nextcloud |
| 33 | image: nextcloud:32 |
| 34 | restart: unless-stopped |
| 35 | mem_limit: 4g |
| 36 | ports: |
| 37 | - 8080:80 |
| 38 | depends_on: |
| 39 | postgres: |
| 40 | condition: service_healthy # Wartet, bis DB wirklich bereit ist |
| 41 | valkey: |
| 42 | condition: service_started |
| 43 | volumes: |
| 44 | - ./nextcloud-data:/var/www/html |
| 45 | environment: |
| 46 | - POSTGRES_HOST=postgres |
| 47 | - POSTGRES_DB=nextcloud |
| 48 | - POSTGRES_USER=nextcloud |
| 49 | - POSTGRES_PASSWORD=XYS22mtSXE5BSP9icaPxFZqw |
| 50 | |
| 51 | - REDIS_HOST=valkey |
| 52 | - REDIS_HOST_PASSWORD=6dfK8X6upA4LmSerMlp11YKW |
| 53 | networks: |
| 54 | - nextcloud-net |
| 55 | |
| 56 | cron: |
| 57 | image: nextcloud:32 |
| 58 | container_name: nextcloud-cron |
| 59 | restart: always |
| 60 | mem_limit: 4g |
| 61 | volumes: |
| 62 | - ./nextcloud-data:/var/www/html |
| 63 | entrypoint: /cron.sh |
| 64 | depends_on: |
| 65 | - postgres |
| 66 | - valkey |
| 67 | networks: |
| 68 | - nextcloud-net |
| 69 | |
| 70 | networks: |
| 71 | nextcloud-net: |
| 72 | driver: bridge |