aguslr / docker-apache-dav

Set up Apache HTTP server to share files via WebDAV

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

publish-docker-image docker-pulls image-size

This Docker image sets up Apache's WebDAV inside a docker container.

Apache is an open-source HTTP server for modern operating systems including UNIX and Windows.

Installation

To use docker-apache-dav, follow these steps:

  1. Clone and start the container:

    docker run -p 80:80 \
      -e HTTP_USER=bob \
      -e HTTP_PASS=123456 \
      -v "${PWD}"/data:/data \
      docker.io/aguslr/apache-dav:latest
    
  2. Configure your Web browser to connect to your Apache server's IP address and login with user HTTP_USER.

Variables

The image is configured using environment variables passed at runtime. All these variables are prefixed by HTTP_.

Variable Function Default Required
USER Username of HTTP user httpuser N
PASS Password of HTTP user autogenerated N

To see the default autogenerated password, check the log for the container:

docker logs <container_name> | grep '^Password'

Custom Apache configuration

If we want to customize Apache we can add these customizations to a custom.conf file:

<Directory "/data/Public">
    <LimitExcept GET PROPFIND OPTIONS HEAD>
       Require valid-user
    </LimitExcept>
</Directory>

Then we can go ahead and mount it as follows:

docker run -p 80:80 \
  -e HTTP_USER=bob \
  -e HTTP_PASS=123456 \
  -v "${PWD}"/data:/data \
  -v "${PWD}"/custom.conf:/etc/apache2/dav.d/custom.conf \
  docker.io/aguslr/apache-dav:latest

Build locally

Instead of pulling the image from a remote repository, you can build it locally:

  1. Clone the repository:

    git clone https://github.com/aguslr/docker-apache-dav.git
    
  2. Change into the newly created directory and use docker-compose to build and launch the container:

    cd docker-apache-dav && docker-compose up --build -d
    

About

Set up Apache HTTP server to share files via WebDAV

License:GNU General Public License v3.0


Languages

Language:Shell 51.2%Language:Dockerfile 48.8%