Skip to content

Commit

Permalink
healthcheck+readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Sonne committed Aug 7, 2024
1 parent 50a389e commit 937dd17
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM alpine

RUN apk add nginx nginx-mod-http-dav-ext shadow tzdata
RUN apk add nginx nginx-mod-http-dav-ext shadow tzdata curl
RUN mkdir /etc/nginx/htpasswd

COPY ./dav.sh /dav.sh

VOLUME /dav
EXPOSE 80

HEALTHCHECK CMD [ "curl", "-fs", "http://localhost" ]

CMD /dav.sh && nginx -g "daemon off;"
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## usage

The image supports setting your UID and GID (to an extent, system-IDs are protected) and timezone.

You can create as many webdav shares as you want, the script checks the environment variables for anything beginning with DAV_, if it's empty, creates a share without authorization, if it contains a string, that's used for htpasswd. $-symbols need to be escaped with another $.

For environment variables beginning with DAV_, the rest of the string is used to:

* Create /dav/<sharename>
* Create nginx-location /<sharename>, including authentication if chosen

By default, the container blocks localhost/ and returns a 204. This can be turned into a share by setting `DAV_root_enable`, as well as `DAV_root_name` if you want to name it anything other than `root` (only relevant for storage). If you want to enable authentication, use `DAV_root_auth`.

## docker-compose
```yaml
services:
webdav:
build: https://github.com/du5tball/docker-webdav.git#main
ports:
- 9000:80
volumes:
- webdav:/dav
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Berlin
- DAV_public=""
- DAV_private=user:$$apr1$$QP3iuIwL$$jVUes5S3Mf4NHDnOW28Lr1 # user / password
- DAV_root_enable=""
- DAV_root_name=steve
- DAV_root_auth=admin:$$apr1$$5KAARrpl$$TlHIXRceiZjH0LoKD9616. # admin / pass
volumes:
webdav: {}
```

0 comments on commit 937dd17

Please sign in to comment.