A static web server with find & replace support for environment variables
50K+
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.
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
Content type
Image
Digest
sha256:49abebb56ā¦
Size
60.2 MB
Last updated
4 months ago
docker pull nstapelbroek/static-webserver