Sign inSign up

nstapelbroek/static-webserver

By nstapelbroek

•Updated 4 months ago

A static web server with find & replace support for environment variables

Image
Web servers
0

50K+

nstapelbroek/static-webserver repository overview

A simple nginx docker image that has the ability to insert environment variables. Created so I could re-use an image between prod and staging environments for my frontend builds. It replaces environment variables on container startup, so you don“t have to rebuild your Docker image or use a server-side language to change some settings.

⁠Example

This repository generates the images available on the Docker hub⁠. Using this image for your own project is as simple as creating a Dockerfile with the two lines below:

FROM nstapelbroek/static-webserver:5
COPY ./your-static-content /var/www

A more modern example where you build your frontend project and ship it:

FROM node:21 as build
WORKDIR /opt/project

COPY package.json package-lock.json /opt/project/
RUN npm ci

COPY . /opt/project
RUN npm run build

FROM nstapelbroek/static-webserver:5
COPY --from=build --chown=nginx:nginx /opt/project/dist /var/www

Read more on GitHub⁠

Tag summary

Content type

Image

Digest

sha256:49abebb56…

Size

60.2 MB

Last updated

4 months ago

docker pull nstapelbroek/static-webserver