🐝 A static server based on superstatic
1.6K
🐝 A static server based on superstatic
PORT
The port on which this server listens (default: 9876)
ROOT
The directory that is served (default: './app')
GZIP
Toggle gzip encoding (default: true)
DEBUG
Toggle debugging (default: false)
ENV_PREFIX
Prefix of ENV VARS passed to the client (read below) (default: 'ENV_')
The server allows making environment variables available to the static client.
It will parse all the environment variables that are prefixed with ENV_ and make them available to the client.
The client can read the file /__/env.js or /__/env.json to access these variables.
In case of /__/env.js there will be an object available on window.__env.
This server is available as a Docker image.
This is an example on how to use it from a Dockerfile:
# Base image.
FROM beeman/static-server:latest
# Copy the app to the image
COPY dist /srv/app/
# Expose the default port
EXPOSE 9876
# Run application.
CMD ["node", "/srv/index.js"]
This is an example on how to use it with docker-compose:
static:
image: beeman/static-server:latest
volumes:
- ./app:/srv/app
ports:
- 9876:9876
environment:
- ENV_API_BASE_URL=https://my-api.now.sh/
- ENV_API_VERSION=api/v1
MIT - Copyright (c) 2016 Bram Borggreve
Content type
Image
Digest
sha256:4d22c5673…
Size
54.1 MB
Last updated
8 months ago
docker pull beeman/static-server