Browse Source

Initial commit

Luca Florio 8 years ago
parent
commit
b9d2662de9
6 changed files with 66 additions and 2 deletions
  1. 25 0
      Dockerfile
  2. 19 2
      README.md
  3. BIN
      apache/.DS_Store
  4. 5 0
      apache/run
  5. 12 0
      dav_svn.conf
  6. 5 0
      subversion/run

+ 25 - 0
Dockerfile

@@ -0,0 +1,25 @@
+# Alpine Linux with s6 service management
+FROM smebberson/alpine-base
+
+	# Install Apache2 and other stuff needed to access svn via WebDav
+RUN apk add --no-cache apache2 apache2-utils apache2-webdav mod_dav_svn &&\
+	# Install svn
+	apk add --no-cache subversion &&\
+
+	# Create required folders
+	mkdir -p /run/apache2/ &&\
+	mkdir /home/svn/ &&\
+	mkdir /etc/subversion &&\
+
+	# Create the authentication file for http access
+	touch /etc/subversion/passwd
+
+# Add services configurations
+ADD apache/ /etc/services.d/apache/
+ADD subversion/ /etc/services.d/subversion/
+
+# Add WebDav configuration
+ADD dav_svn.conf /etc/apache2/conf.d/dav_svn.conf
+
+# Expose ports for http and custom protocol access
+EXPOSE 80 443 3960

+ 19 - 2
README.md

@@ -1,2 +1,19 @@
-# svn-docker
-Lightweight Docker image to build a container running an SVN server
+# Description
+Lightweight container providing an SVN server, based on **Alpine Linux** and S6 process management (see [here](https://github.com/smebberson/docker-alpine) for details).
+The access to the server is possible via **WebDav protocol** (http://), and via **custom protocol** (svn://).
+
+# Running Commands
+To run the image, you can use the following command:
+```
+docker run -d --name svn-server -p 80:80 -p 3960:3960 elleflorio/svn-server
+```
+You can optionally bind a local folder to the container folder that will store your repositories using the flag `-v <hostpath>:/home/svn`.
+
+# Configuration
+**You need to setup username and password** for the access via WebDav protocol. You can use the following command from you host machine:
+```
+docker exec -t svn-server htpasswd -b /etc/subversion/passwd <username> <password>
+```
+To verify that everything is up and running, open you browser and connect to `http://localhost/svn`. The system should ask you for the username and password, then it will show you and empty folder (no repos yet!).
+Check also that the custom protocol is working fine: go to you terminal and type `svn info svn://localhost:3960`. The system should connect to the server and tell you that is not able to find any repository.
+For further information on how to configure Subversion, please refer to the [official web page](https://subversion.apache.org/).

BIN
apache/.DS_Store


+ 5 - 0
apache/run

@@ -0,0 +1,5 @@
+#!/usr/bin/with-contenv sh
+
+# From https://github.com/smebberson/docker-alpine/tree/master/alpine-apache
+
+exec /usr/sbin/apachectl -DFOREGROUND;

+ 12 - 0
dav_svn.conf

@@ -0,0 +1,12 @@
+LoadModule dav_svn_module /usr/lib/apache2/mod_dav_svn.so
+LoadModule authz_svn_module /usr/lib/apache2/mod_authz_svn.so
+
+<Location /svn>
+     DAV svn
+     SVNParentPath /home/svn
+     SVNListParentPath On
+     AuthType Basic
+     AuthName "Subversion Repository"
+     AuthUserFile /etc/subversion/passwd
+     Require valid-user
+  </Location>

+ 5 - 0
subversion/run

@@ -0,0 +1,5 @@
+#!/usr/bin/with-contenv sh
+
+# From https://github.com/smebberson/docker-alpine/tree/master/alpine-apache
+
+exec /usr/bin/svnserve -d --foreground -r /home/svn --listen-port 3960;