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.
To use docker-apache-dav, follow these steps:
-
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
-
Configure your Web browser to connect to your Apache server's IP address and login with user
HTTP_USER
.
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'
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
Instead of pulling the image from a remote repository, you can build it locally:
-
Clone the repository:
git clone https://github.com/aguslr/docker-apache-dav.git
-
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