diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..b1388a7648a84e8c7c839f19112e0076b759c194 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +content/* +frontend.env diff --git a/README.md b/README.md index 0263f53596f4c3ae5c2065a41bff0fe2ce4b6ca0..c53e1864c8491798930f0a54b86f531e9b6a8364 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 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/content/index.html b/content/index.html deleted file mode 100644 index cadafc690f035680811701806522d7238df142e8..0000000000000000000000000000000000000000 --- 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 edc6249f9ebc5012d2a9164d3c8d4404cc532702..b4ca01df565414b936f00cc60a2e2d486a664f1d 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 0000000000000000000000000000000000000000..d22533dd970e7cea472eb511bba4e49a23b7887c --- /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