GithubHelp home page GithubHelp logo

nabbi / docker-lighttpd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rtsp/docker-lighttpd

0.0 0.0 0.0 126 KB

lighttpd web server with default config optimized for high traffic frontend website

Home Page: https://hub.docker.com/r/rtsp/lighttpd

License: Apache License 2.0

Makefile 23.66% Dockerfile 76.34%

docker-lighttpd's Introduction

lighttpd Docker Image

  • lighttpd is a secure, fast, compliant, and very flexible web-server that has been optimized for high-performance environments
  • docker-lighttpd is a lighttpd docker image designed to use as base image for building frontend/static web app docker image (e.g. React)

Base Image

  • Use docker-lighttpd as a base image (FROM) and copy your web artifacts to /var/www/html
  • Optimized for serving high traffic frontend/static web app

Useful Info

Paths

  • /var/www/html - Document root
  • /etc/lighttpd/lighttpd.conf - Entry point of to include configs from conf.d/*.conf
  • /etc/lighttpd/conf.d/
    • 00-mime-types.conf - MIME types definition derived from NGINX /etc/nginx/mime.types
    • 01-server.conf 05-webroot.conf 11-access.conf - Configs derived from the default lighttpd.conf
    • 12-expire.conf 13-status.conf 14-rewrite.conf - Example configs for several use cases

Feel free to replace or modify these config files if required!

Default Config (lighttpd.conf)

  • Run as lighttpd user
  • Listen on port 80
  • No SSL/HTTPS (designed to run behind load balancer or reverse proxy server)
  • No log file writing
  • No Cache-Control header

Examples

Dockerize React App (Multi-Stage Build)

FROM node:14 AS builder

COPY package.json \
     package-lock.json \
     /usr/web/

WORKDIR /usr/web/
RUN npm ci

COPY public/ /usr/web/public/
COPY src/ /usr/web/src/
RUN npm run build

FROM rtsp/lighttpd
COPY --from=builder /usr/web/build/ /var/www/html/

Directly use as Web Server (Volume mount)

docker run -d \
  --name your-webapp \
  -v /webapp/dir:/var/www/html:ro \
  -p 8080:80 \
  rtsp/lighttpd
  • Mount /webapp/dir as your web app document root
  • Publish website to port 8080 of Docker host machine.
  • Enter http://localhost:8080

Links

docker-lighttpd's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar rtsp avatar

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.