From a296ffd24e23be57f4adfea3f253c17b898ff336 Mon Sep 17 00:00:00 2001 From: ecobytes collective <status@ecobytes.net> Date: Wed, 19 Feb 2020 18:40:48 +0100 Subject: [PATCH] update compose and frontend routing examples --- .gitignore | 2 ++ README.md | 22 ++++++++++++++++------ content/.gitkeep | 0 content/index.html | 2 -- docker-compose.yml | 17 ++++++++++------- frontend.env.example | 4 ++++ 6 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 .gitignore create mode 100644 content/.gitkeep delete mode 100644 content/index.html create mode 100644 frontend.env.example diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b1388a7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +content/* +frontend.env diff --git a/README.md b/README.md index 0263f53..c53e186 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ -# docker-lighttpd-static +# compose-lighttpd -Docker container for serving static content using lighttpd +Docker container and compose file for serving static content using lighttpd ## Executing - docker run --name "my-lighttpd" -P -v $(pwd)/example-content:/var/www jojomi/lighttpd-static + docker run --name "my-lighttpd" -P -v $(pwd)/content:/var/www allmende/lighttpd Find your container: docker ps | grep "my-lighttpd" CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - ba00b5c238fc jojomi/lighttpd-static:latest "lighttpd -D -f /etc 1 second ago Up 1 second 0.0.0.0:49153->80/tcp my-lighttpd + ba00b5c238fc allmende/lighttpd:latest "lighttpd -D -f /etc 1 second ago Up 1 second 0.0.0.0:49153->80/tcp my-lighttpd Check if it works: @@ -21,9 +21,19 @@ Check if it works: ## Building The Image Yourself (optional) - docker build -t jojomi/lighttpd-static . + docker build -t allmende/lighttpd . The image is conveniently small at **below 7 MB** thanks to [alpine](http://gliderlabs.viewdocs.io/docker-alpine): docker images | grep lighttpd - jojomi/lighttpd-static latest b2e7a8364baa 1 second ago 6.451 MB + allmende/lighttpd latest b2e7a8364baa 1 second ago 6.451 MB + +## Using with Docker Compose + +You can use the image with the Docker Compose file provided. + +In case you are using jwilder/nginx as a frontend proxy, copy `frontend.env.example` to `frontend.env` and fill it with your details. + +In case you are using træfik, uncomment and configure the labels appropriately. + +Then place files you seek to serve into `content/` and fire it up! diff --git a/content/.gitkeep b/content/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/content/index.html b/content/index.html deleted file mode 100644 index cadafc6..0000000 --- a/content/index.html +++ /dev/null @@ -1,2 +0,0 @@ -foo bar -fizz buzz diff --git a/docker-compose.yml b/docker-compose.yml index edc6249..b4ca01d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,19 +4,22 @@ services: static: build: . - environment: - VIRTUAL_HOST: '' - VIRTUAL_PORT: '80' - LETSENCRYPT_HOST: '' - LETSENCRYPT_EMAIL: 'status@ecobytes.net' + # env_files: ["./frontend.env"] # for use with jwilder/nginx + # labels: # for use with træfik + # - traefik.enable=true + # - traefik.backend= # fill here + # - traefik.frontend.rule=Host: # fill here + # - traefik.frontend.passHostHeader=true + # - traefik.docker.network=web + # - traefik.port=3000 volumes: - ./content/:/var/www - ./lighttpd.conf:/etc/lighttpd/lighttpd.conf expose: - 80 networks: - - frontend-web + - web networks: - frontend-web: + web: external: true diff --git a/frontend.env.example b/frontend.env.example new file mode 100644 index 0000000..d22533d --- /dev/null +++ b/frontend.env.example @@ -0,0 +1,4 @@ +VIRTUAL_HOST= # comma-delimited list of FQDNs without quotes +VIRTUAL_PORT=80 +LETSENCRYPT_HOST= # same as above +LETSENCRYPT_EMAIL=status@ecobytes.net -- GitLab