Owncloud container with externalized data/configuration and optional HTTPS support
3.0K
An owncloud 8.0.2 container designed for a simple standalone deployment. Key features are:
/owncloud-data)ocdb aliasThe configuration of the container was created following the support guide suggested by owncloud's manual installation guide.
The command below will setup a running owncloud container with externalized data/configuration
docker run -d --name owncloud -h owncloud -d -p 80:80 -v /owncloud_mnt:/owncloud-data xetusoss/owncloud
The following parameters are used every time the container is replaced, regardless of the externalized configurations.
true if SSL_CERT and SSL_KEY are defined, otherwise false./owncloud-data/ssl/crt.pem./owncloud-data/ssl/key.pem.The following parameters are only used to setup the initial configuration. Once the configuration has been established, theses are not used. All the parameters here map to configuration values in the owncloud config.php.
See the owncloud documentation for what each parameter does. The goal here is not to support every parameter, just those parameters that you really would like to have in place before you get the the UI.
Make sure /somepath/owncloud_mnt exists
docker run --name owncloud -h owncloud -d -p 443:443\
-e SSL_ENABLED=true -v /somepath/owncloud_mnt:/owncloud-data xetusoss/owncloud
Create a public/private key pair and place them in data mount under ssl/crt.pem and ssl/key.pem. The locations can be changed using the SSL_CERT and SSL_KEY environment variables.
docker run --name owncloud -h owncloud -d -p 443:443\
-e SSL_ENABLED=true -v /somepath/owncloud_mnt:/owncloud-data xetusoss/owncloud
The example below creates a owncloud container with the linked mysql db
docker run --name owncloud -h owncloud -p 443:443\
-v /somepath/owncloud_mnt:/owncloud-data --link mysql:ocdb -e DB_TYPE="mysql"\
-e DB_USER="SOMEUSER" -e DB_PASS="SOMEPASS" -e SSL_ENABLED=true xetusoss/owncloud
The example below creates a owncloud container using an external db
docker run --name owncloud -h owncloud -p 443:443\
-v /somepath/owncloud_mnt:/owncloud-data -e DB_TYPE="mysql"\
-e DB_HOST="db.example.com:3306"-e DB_USER="SOMEUSER"\
-e DB_PASS="SOMEPASS" -e SSL_ENABLED=true xetusoss/owncloud
The externalized data directory contains 4 directories: data, config, apps, and dotfiles
The data, config, and apps directory are all standard in an owncloud installation, so reference the owncloud documentation for those. dotfiles is a custom directory because owncloud stores certain configuration settings in the .htaccess and .user.ini files that should persist between container replacements.
otherIn order for the apache processes in the container to properly read the files in the dotfiles directory (.htaccess, etc), the executable bit must be set on the volume folder in the host.
We went through each of the 130+ owncloud containers available on docker hub, and we (amazingly) couldn't find a container that both properly externalized the data/configuration and supported SSL with custom CA certificates. Since this is such a pleasantly simple task, we decided to just our own.
Pull requests/code copying is welcome.
Content type
Image
Digest
sha256:9fe50848a…
Size
241.9 MB
Last updated
almost 11 years ago
docker pull xetusoss/owncloud