-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
xama5
committed
May 6, 2017
1 parent
5c69bb5
commit aa6d2df
Showing
2 changed files
with
17 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
FROM debian:jessie | ||
MAINTAINER [email protected] | ||
|
||
WORKDIR /var/webdav | ||
|
||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y nginx php5-fpm && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
# Install SabreDAV | ||
RUN php -r "readfile('http://getcomposer.org/installer');" > composer-setup.php && \ | ||
php composer-setup.php --install-dir=/usr/bin --filename=composer && \ | ||
php -r "unlink('composer-setup.php');" && \ | ||
composer require sabre/dav ~3.1.3 && \ | ||
rm /usr/bin/composer | ||
|
||
# Default webdav user (CHANGE THIS!) | ||
ENV WEBDAV_USERNAME admin | ||
ENV WEBDAV_PASSWORD admin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,12 @@ | ||
#!/bin/bash | ||
|
||
############################################################################### | ||
# This is an install script for my Docker WebDAV (based on nginx) approach. | ||
# Author: Oliver Lazovic (https://www.xama.us) | ||
############################################################################### | ||
## | ||
# Instructions to be executed on container start | ||
## | ||
|
||
# Directories | ||
mkdir /var/webdav | ||
chmod -R 755 /var/webdav | ||
|
||
# Working directory | ||
cd /var/webdav | ||
|
||
# SabreDAV Directories | ||
mkdir data | ||
mkdir public | ||
touch .htdigest | ||
chmod a+rwx data public .htdigest | ||
|
||
# Install composer | ||
php -r "readfile('http://getcomposer.org/installer');" > composer-setup.php | ||
php composer-setup.php --install-dir=/usr/bin --filename=composer # As executable | ||
php -r "unlink('composer-setup.php');" | ||
|
||
# Fetch SabreDAV | ||
composer require sabre/dav ~3.1.3 | ||
composer update sabre/dav | ||
# Fix possible permission errors | ||
chown -R www-data:www-data /var/webdav | ||
chmod -R 777 /var/webdav | ||
|
||
# Create authentication file | ||
echo "$WEBDAV_USERNAME:SabreDAV:$(php -r "echo md5('$WEBDAV_USERNAME:SabreDAV:$WEBDAV_PASSWORD');")" >> .htdigest | ||
echo "$WEBDAV_USERNAME:SabreDAV:$(php -r "echo md5('$WEBDAV_USERNAME:SabreDAV:$WEBDAV_PASSWORD');")" >> .htdigest |