spujadas / lighttpd-docker

Docker image for lighttpd, a secure, fast, compliant, and flexible web server
MIT License
59 stars 66 forks source link
docker-image lighttpd lighttpd-docker

lighttpd Docker image

Security, speed, compliance, and flexibility -- all of these describe lighttpd

Contents

Usage

In the instructions that follow, replace:

Start a container with Docker

With the default configuration files:

$ sudo docker run --rm -t -v <home-directory>:/var/www/localhost/htdocs -p <http-port>:80 sebp/lighttpd

With custom configuration files:

$ sudo docker run --rm -t -v <home-directory>:/var/www/localhost/htdocs -v <config-directory>:/etc/lighttpd -p <http-port>:80 sebp/lighttpd

Start a container with Docker Compose

Add the following lines in an existing or a new docker-compose.yml file:

lighttpd:
  image: sebp/lighttpd
  volumes:
    - <home-directory>:/var/www/localhost/htdocs
    - <config-directory>:/etc/lighttpd
  ports:
    - "<http-port>:80"
  tty: true

Note – The - <config-directory>:… line is optional, it can be used to override the default configuration files with your own.

Then start a lighttpd container with:

$ sudo docker-compose up lighttpd

Build

First clone or download the spujadas/lighttpd-docker GitHub repository, open a shell in the newly created lighttpd-docker directory, then build the image and run a container using Docker, Docker Compose, or Docker Buildx, as explained below.

Build with Docker

This command will build the image:

$ sudo docker build .

Build with Docker Compose

Build the image with this command:

$ sudo docker-compose build

Build with Docker Buildx

Build the image with this command:

$ sudo buildx build .

About

Written by Sébastien Pujadas, released under the MIT license.