snackpot.yml - add docker compose config
Nominally working and tested on a remote VM
This commit is contained in:
103
templates/docker-compose/docker-compose.yml
Normal file
103
templates/docker-compose/docker-compose.yml
Normal file
@@ -0,0 +1,103 @@
|
||||
---
|
||||
# Adapted from:
|
||||
# https://github.com/nextcloud/docker/blob/master/.examples/docker-compose/with-nginx-proxy/postgres/fpm/docker-compose.yml
|
||||
|
||||
version: '3'
|
||||
|
||||
volumes:
|
||||
postgres:
|
||||
nextcloud_src:
|
||||
nextcloud_data:
|
||||
certs:
|
||||
vhost.d:
|
||||
html:
|
||||
redis:
|
||||
|
||||
networks:
|
||||
proxy-tier:
|
||||
|
||||
services:
|
||||
|
||||
postgres:
|
||||
build: ./postgres
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||
volumes:
|
||||
- postgres:/var/lib/postgresql/data
|
||||
env_file:
|
||||
- postgres.env
|
||||
# Expose postgresql's port to allow dumping to back-up
|
||||
# ports:
|
||||
# - "127.0.0.1:5432:5432"
|
||||
# ext_file?
|
||||
|
||||
redis:
|
||||
restart: always
|
||||
image: redis:6.0.9-alpine
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
volumes:
|
||||
- redis:/data
|
||||
|
||||
nextcloud:
|
||||
image: nextcloud:17.0.2-fpm-alpine
|
||||
restart: always
|
||||
volumes:
|
||||
- nextcloud_src:{{ nextcloud_base_dir }}
|
||||
- nextcloud_data:{{ nextcloud_data_dir }}
|
||||
links:
|
||||
- postgres
|
||||
- redis
|
||||
env_file:
|
||||
- nextcloud.env
|
||||
environment:
|
||||
- POSTGRES_HOST=postgres
|
||||
- REDIS_HOST=redis
|
||||
- POSTGRES_USER=nextcloud
|
||||
# healthcheck:
|
||||
# test: ["CMD-SHELL", "wget -q --spider --proxy=off localhost:3000/health || exit 1"]
|
||||
|
||||
web:
|
||||
build: ./web
|
||||
restart: always
|
||||
volumes:
|
||||
- nextcloud_src:/var/www/html:ro
|
||||
env_file:
|
||||
- web.env
|
||||
depends_on:
|
||||
- nextcloud
|
||||
networks:
|
||||
- proxy-tier
|
||||
- default
|
||||
|
||||
proxy:
|
||||
build: ./proxy
|
||||
restart: always
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
labels:
|
||||
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
|
||||
volumes:
|
||||
- certs:/etc/nginx/certs:ro
|
||||
- vhost.d:/etc/nginx/vhost.d
|
||||
- html:/usr/share/nginx/html
|
||||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||
networks:
|
||||
- proxy-tier
|
||||
|
||||
letsencrypt-companion:
|
||||
image: jrcs/letsencrypt-nginx-proxy-companion:v1.13.1
|
||||
restart: always
|
||||
volumes:
|
||||
- certs:/etc/nginx/certs
|
||||
- vhost.d:/etc/nginx/vhost.d
|
||||
- html:/usr/share/nginx/html
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
networks:
|
||||
- proxy-tier
|
||||
depends_on:
|
||||
- proxy
|
||||
env_file:
|
||||
- letsencrypt-companion.env
|
||||
Reference in New Issue
Block a user