Giter VIP home page Giter VIP logo

docker-nginx-webdav's Introduction

docker-nginx-webdav

This image runs an easily configurable WebDAV server with nginx, support plain, selfsigned or Let's Encrypt certificate.

Usage

Basic WebDAV server

This example starts a WebDAV server on port 80. It can only be accessed with a single username and password.

docker run --restart always -v /path/to/directory:/media \
    -e USERNAME=jinlife -e PASSWORD=123123 \
    --publish 80:80 -d jinlife/docker-nginx-webdav

Via Docker Compose:

version: '3'
services:
  webdav:
    image: jinlife/docker-nginx-webdav
    restart: always
    ports:
      - "80:80"
    environment:
      USERNAME: jinlife
      PASSWORD: 123123
    volumes:
      - /path/to/directory:/media

Secure WebDAV with SSL

Self signed certificate

If you're happy with a self-signed certificate, specify -e DOMAIN=youdomain.com,192.168.0.88,xxx and the container will generate one cert and key for all domain or ip.

docker run --restart always -v /path/to/directory:/media \
    -e USERNAME=jinlife -e PASSWORD=123123 \
    -e DOMAIN=youdomain.com,192.168.0.88 --publish 443:443 -d jinlife/docker-nginx-webdav

Let's Encrypt certificate

If you want the caddy to auto generate Let's Encrypt certificate for you , then specify -e DOMAIN=youdomain.com with only one domain and specify -e EMAIL=CloudflareAccountEmail.com and -e TOKEN_KEY=Cloudflare_TOKEN_KEY to be used in acme.

This is only suitable for Cloudflare managed Domain and use DNS to generate the SSL。It will also succeed for non 443 HTTPS server.

docker run --restart always -v /path/to/directory:/media \
    -e USERNAME=jinlife -e PASSWORD=123123 \
    -e DOMAIN=youdomain.com -e EMAIL=youremail.com -e TOKEN_KEY=xxxxxxxxx --publish 443:443 -d docker-nginx-webdav

Environment variables

All environment variables are optional. You probably want to at least specify USERNAME and PASSWORD otherwise nobody will be able to access your WebDAV server!

  • DOMAIN: Comma-separated list of domains (eg, example.com,www.example.com). multiple domains are for self signed certificate and one domain is for Let's Encrypt certificate.
  • EMAIL: EMAIL defined to generate Let's Encrypt certificate, if not defined, then docker will auto switch to self signed certificate.
  • TOKEN_KEY: TOKEN_KEY defined to store the cloudflare TOKEN_KEY, not GLOBAL API KEY, The TOKEN_KEY generate with ZONE:ZONE:READ and ZONE:DNS:EDIT permission
  • USERNAME: Authenticate with this username
  • PASSWORD: Authenticate with this password

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.