103 lines
2.7 KiB
Django/Jinja
103 lines
2.7 KiB
Django/Jinja
services:
|
|
|
|
db:
|
|
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
|
|
ports:
|
|
- 9000:9000
|
|
env_file:
|
|
- .webserver.env
|
|
environment:
|
|
VIRTUAL_HOST: "{{ inventory_hostname | default('ansible_undefined_fact') }}"
|
|
NEXTCLOUD_ADMIN_USER: "admin"
|
|
POSTGRES_DB: "nextcloud"
|
|
POSTGRES_USER: "postgres"
|
|
POSTGRES_HOST: "database"
|
|
NEXTCLOUD_TRUSTED_DOMAINS: "{{ inventory_hostname | default('ansible_undefined_fact') }}"
|
|
volumes:
|
|
- ~/webroot:/var/www/html
|
|
# NOTE: The `volumes` config of the `cron` and `app` containers must match
|
|
environment:
|
|
- POSTGRES_HOST=db
|
|
- REDIS_HOST=redis
|
|
env_file:
|
|
- db.env
|
|
depends_on:
|
|
- db
|
|
- redis
|
|
- 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
|
|
ports:
|
|
- 8080:8080
|
|
- 4443:4443
|
|
environment:
|
|
HTTP_PORT: 8080
|
|
HTTPS_PORT: 4443
|
|
labels:
|
|
- "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy"
|
|
volumes:
|
|
- /home/{{ user.name }}/nginx/vhost.d:/etc/nginx/vhost.d
|
|
- /home/{{ user.name }}/nginx/certs:/etc/nginx/certs
|
|
- /run/user/1000/podman/podman.sock:/tmp/docker.sock:z,ro
|
|
networks:
|
|
- proxy-tier
|
|
|
|
|
|
volumes:
|
|
db:
|
|
|
|
networks:
|
|
proxy-tier:
|