Skip to content

Instantly share code, notes, and snippets.

@tderick
Created May 9, 2022 00:57
Show Gist options
  • Save tderick/f96ecccf5d79bf7b1b3906d4347a6436 to your computer and use it in GitHub Desktop.
Save tderick/f96ecccf5d79bf7b1b3906d4347a6436 to your computer and use it in GitHub Desktop.
This gist contains the docker-compose file and .env file for the deployment of Owncloud behind jwilder/nginx-proxy
OWNCLOUD_VERSION=latest
OWNCLOUD_DOMAIN=cloud.example.com
ADMIN_USERNAME=admin
ADMIN_PASSWORD=admin
HTTP_PORT=8080
LETSENCRYPT_EMAIL=example@gmail.com
version: "3.9"
volumes:
files:
driver: local
mysql:
driver: local
redis:
driver: local
services:
owncloud:
image: owncloud/server:${OWNCLOUD_VERSION}
container_name: owncloud_server
restart: always
depends_on:
- mariadb
- redis
environment:
- OWNCLOUD_DOMAIN=${OWNCLOUD_DOMAIN}
- OWNCLOUD_DB_TYPE=mysql
- OWNCLOUD_DB_NAME=owncloud
- OWNCLOUD_DB_USERNAME=owncloud
- OWNCLOUD_DB_PASSWORD=owncloud
- OWNCLOUD_DB_HOST=mariadb
- OWNCLOUD_ADMIN_USERNAME=${ADMIN_USERNAME}
- OWNCLOUD_ADMIN_PASSWORD=${ADMIN_PASSWORD}
- OWNCLOUD_MYSQL_UTF8MB4=true
- OWNCLOUD_REDIS_ENABLED=true
- OWNCLOUD_REDIS_HOST=redis
- VIRTUAL_HOST=${OWNCLOUD_DOMAIN}
- LETSENCRYPT_HOST=${OWNCLOUD_DOMAIN}
- LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
- VIRTUAL_PORT=${HTTP_PORT}
healthcheck:
test: ["CMD", "/usr/bin/healthcheck"]
interval: 30s
timeout: 10s
retries: 5
volumes:
- files:/mnt/data
mariadb:
image: mariadb:10.5
container_name: owncloud_mariadb
restart: always
environment:
- MYSQL_ROOT_PASSWORD=owncloud
- MYSQL_USER=owncloud
- MYSQL_PASSWORD=owncloud
- MYSQL_DATABASE=owncloud
command: ["--max-allowed-packet=128M", "--innodb-log-file-size=64M"]
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-u", "root", "--password=owncloud"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- mysql:/var/lib/mysql
redis:
image: redis:6
container_name: owncloud_redis
restart: always
command: ["--databases", "1"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- redis:/data
#Use this configuration in production with nginx-proxy container
networks:
default:
name: nginx-proxy
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment