A Docker base image for serving static websites
- Create a
Dockerfile
and include theglenndehaan/static-server
as base image or use theExample Dockerfile
below - Build and run your container with port 80 forwarded to for example port 3000
- Visit: http://localhost:3000 to see your app
Make sure you have docker installed in your machine then run the following command in your terminal:
docker compose up
# Define Base Image
FROM glenndehaan/static-server
# Create web directory
WORKDIR /www
# Bundle web source
COPY . .