Using postgres fpm example from official git repo

This commit is contained in:
Mike Holloway 2025-12-04 19:13:49 -05:00
parent 7480b2e244
commit f343b26fe9

View File

@ -1,57 +1,102 @@
version: '3.6'
services: services:
nextcloud: db:
image: nextcloud:stable-fpm image: postgres:alpine
restart: always
hostname: database
environment:
POSTGRES_DB: "nextcloud"
volumes:
- db:/var/lib/postgresql/data:Z
env_file:
- db.env
redis:
image: redis:alpine
restart: always
app:
image: nextcloud:fpm-alpine
restart: always restart: always
ports: ports:
- 9000:9000 - 9000:9000
env_file: env_file:
- .webserver.env - .webserver.env
environment: environment:
VIRTUAL_PROTO: "fastcgi"
VIRTUAL_HOST: "{{ inventory_hostname | default('ansible_undefined_fact') }}" VIRTUAL_HOST: "{{ inventory_hostname | default('ansible_undefined_fact') }}"
VIRTUAL_ROOT: "/var/www/html/"
LETSENCRYPT_HOST: "{{ inventory_hostname | default('ansible_undefined_fact') }}"
NEXTCLOUD_ADMIN_USER: "admin" NEXTCLOUD_ADMIN_USER: "admin"
POSTGRES_DB: "nextcloud" POSTGRES_DB: "nextcloud"
POSTGRES_USER: "postgres" POSTGRES_USER: "postgres"
POSTGRES_HOST: "database" POSTGRES_HOST: "database"
NEXTCLOUD_TRUSTED_DOMAINS: "{{ inventory_hostname | default('ansible_undefined_fact') }}" NEXTCLOUD_TRUSTED_DOMAINS: "{{ inventory_hostname | default('ansible_undefined_fact') }}"
hostname: webserver
networks:
default:
aliases:
- "test-eqit.lan"
volumes: volumes:
- ~/webroot:/var/www/html - ~/webroot:/var/www/html
# NOTE: The `volumes` config of the `cron` and `app` containers must match
database:
image: postgres:latest
restart: always
hostname: database
env_file:
- .db.env
environment: environment:
POSTGRES_DB: "nextcloud" - POSTGRES_HOST=db
networks: - REDIS_HOST=redis
default: env_file:
aliases: - db.env
"nextcloud-db.lan" depends_on:
- db
- redis
- proxy
nginx-proxy: # Note: Nginx is an external service. You can find more information about the configuration here:
# https://hub.docker.com/_/nginx/
web:
image: nginx:alpine-slim
restart: always
volumes:
# https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html
- ./web/nginx.conf:/etc/nginx/nginx.conf:ro
# NOTE: The `volumes` included below should match those of the `app` container (unless you know what you're doing)
- ~/webroot:/var/www/html:z,ro
environment:
- VIRTUAL_HOST=
- LETSENCRYPT_HOST=
- LETSENCRYPT_EMAIL=
depends_on:
- app
networks:
- proxy-tier
- default
cron:
image: nextcloud:fpm-alpine
restart: always
volumes:
- ~/webroot:/var/www/html
# NOTE: The `volumes` config of the `cron` and `app` containers must match
entrypoint: /cron.sh
depends_on:
- db
- redis
# Note: Nginx-proxy is an external service. You can find more information about the configuration here:
# Warning: Do not use :latest tags of nginx-proxy unless absolutely sure about the consequences.
# https://hub.docker.com/r/nginxproxy/nginx-proxy
proxy:
image: nginxproxy/nginx-proxy:alpine
restart: unless-stopped restart: unless-stopped
ports: ports:
- 8080:8080 - 8080:8080
- 4443:4443 - 4443:4443
image: nginxproxy/nginx-proxy:1.9-alpine
hostname: nginxproxy
environment: environment:
HTTP_PORT: 8080 HTTP_PORT: 8080
HTTPS_PORT: 4443 HTTPS_PORT: 4443
labels:
- "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy"
volumes: volumes:
- /run/user/1000/podman/podman.sock:/tmp/docker.sock:ro - /home/{{ user.name }}/nginx/vhost.d:/etc/nginx/vhost.d
- /home/nextcloud/nginx/certs:/etc/nginx/certs - /home/{{ user.name }}/nginx/certs:/etc/nginx/certs
- /home/nextcloud/nginx/challenges:/usr/share/nginx/html - /run/user/1000/podman/podman.sock:/tmp/docker.sock:z,ro
- /home/nextcloud/nginx/vhost.d:/etc/nginx/vhost.d networks:
- proxy-tier
volumes:
db:
networks:
proxy-tier: