Sign inSign up

ogulcanaydogan/static-server

By ogulcanaydogan

Updated 7 months ago

Lightweight static file server with Nginx, optimized for SPAs

Image
0

802

ogulcanaydogan/static-server repository overview

Static Server

Lightweight static file server with Nginx, optimized for SPAs and static sites.

Quick Start

docker run -p 80:80 -v $(pwd)/dist:/usr/share/nginx/html ogulcanaydogan/static-server

Features

  • Nginx-based static file serving
  • SPA support (client-side routing)
  • Gzip compression
  • Custom error pages
  • Cache headers
  • Health check endpoint

Environment Variables

VariableDescriptionDefault
PORTServer port80
SPA_MODEEnable SPA routing (fallback to index.html)true
GZIPEnable gzip compressiontrue

Usage as Base Image

FROM node:20-alpine AS build
WORKDIR /app
COPY . .
RUN npm ci && npm run build

FROM ogulcanaydogan/static-server
COPY --from=build /app/dist /usr/share/nginx/html

License

MIT

Tag summary

Content type

Image

Digest

sha256:2213a3529

Size

26 MB

Last updated

7 months ago

docker pull ogulcanaydogan/static-server