Skip to content

Instantly share code, notes, and snippets.

@gmolveau
Last active June 12, 2022 23:43
Show Gist options
  • Save gmolveau/f7837eb7ecd09bf65aede4ac38fe9ef4 to your computer and use it in GitHub Desktop.
Save gmolveau/f7837eb7ecd09bf65aede4ac38fe9ef4 to your computer and use it in GitHub Desktop.
docker-compose nextcloud collabora nginx proxy letsencrypt
version: '3'
services:
nextcloud_db:
image: mariadb
container_name: nextcloud_db
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- nextcloud_db:/var/lib/mysql
env_file:
- nextcloud_db.env
nextcloud_app:
image: nextcloud:apache
container_name: nextcloud_app
restart: always
depends_on:
- nextcloud_db
volumes:
- nextcloud_data:/var/www/html
environment:
- VIRTUAL_HOST=<YOUR_NEXTCLOUD_DOMAIN>
- LETSENCRYPT_HOST=<YOUR_NEXTCLOUD_DOMAIN>
- MYSQL_HOST=nextcloud_db
env_file:
- nextcloud_db.env
networks:
- proxy-tier
- default
collabora:
image: collabora/code
container_name: collabora
restart: always
expose:
- 9980
environment:
- domain=<YOUR_NEXTCLOUD_DOMAIN>
- VIRTUAL_HOST=<YOUR_COLLABORA_DOMAIN>
- VIRTUAL_PROTO=https
- VIRTUAL_PORT=9980
- LETSENCRYPT_HOST=<YOUR_COLLABORA_DOMAIN>
cap_add:
- MKNOD
networks:
- proxy-tier
nginx_proxy:
build:
context: .
dockerfile: nginx_proxy.dockerfile
container_name: nginx_proxy
restart: always
ports:
- 80:80
- 443:443
labels:
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
volumes:
- nginx_conf.d:/etc/nginx/conf.d
- nginx_certs:/etc/nginx/certs:ro
- nginx_vhost.d:/etc/nginx/vhost.d
- nginx_htpasswd:/etc/nginx/htpasswd:ro
- nginx_html:/usr/share/nginx/html
- /var/run/docker.sock:/tmp/docker.sock:ro
networks:
- proxy-tier
letsencrypt_companion:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: nginx_proxy_companion
restart: always
depends_on:
- nginx_proxy
environment:
- DEFAULT_EMAIL=<your-mail>
volumes:
- nginx_conf.d:/etc/nginx/conf.d
- nginx_certs:/etc/nginx/certs
- nginx_vhost.d:/etc/nginx/vhost.d
- nginx_html:/usr/share/nginx/html
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- proxy-tier
volumes:
nextcloud_db:
nextcloud_data:
nginx_certs:
nginx_conf.d:
nginx_htpasswd:
nginx_vhost.d:
nginx_html:
networks:
proxy-tier:
MYSQL_ROOT_PASSWORD=<THE_ROOT_PASSWORD>
MYSQL_PASSWORD=<THE_USER_PASSWORD>
MYSQL_DATABASE=nextcloud
MYSQL_USER=nextcloud
FROM jwilder/nginx-proxy:alpine
RUN echo -e "client_max_body_size 10G;\nproxy_request_buffering off;" > /etc/nginx/conf.d/uploadsize.conf
@graphpivot
Copy link

In order tu run nextcloud from the iOS or Android App one have to execute once sudo docker-compose exec --user www-data nextcloud_app php occ config:system:set overwriteprotocol --value="https", see ticket for the Android app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment