Skip to content

Commit

Permalink
Include SabreDAV in docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
xama5 committed May 6, 2017
1 parent 5c69bb5 commit aa6d2df
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
10 changes: 10 additions & 0 deletions Dockerfile
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
Expand Down
33 changes: 7 additions & 26 deletions scripts/install.sh
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

0 comments on commit aa6d2df

Please sign in to comment.