Nginx Static Site with Docker Compose
Nginx serving files from a local folder. The services are ticked below: set your project name and port, then copy compose.yaml and .env.
- Free
- No Sign-Up
- Runs in Your Browser
Services
compose.yaml
# compose.yaml, generated at frabs.net/tools/docker-compose-generator/
services:
nginx:
image: nginx:1.27-alpine
restart: unless-stopped
ports:
- "8080:80"
volumes:
- ./site:/usr/share/nginx/html:ro
Start It
docker compose up -d && docker compose ps
Docker Compose Generator
What you get
Servicesnginx
ImagesPinned to a major version
DataNamed volumes
Secrets.env file
DatabasesNot published to the internet
Nginx serving files from a local folder.
Start it with docker compose up -d; update later with docker compose pull && docker compose up -d.
Stacks
Questions
How do I run Nginx Static Site with Docker Compose?
Save compose.yaml and .env in an empty folder, set real passwords in .env, then run docker compose up -d.
Free Tools
More tools
Docker Compose GeneratorStarter compose.yaml files for common stacks, with safe defaults.Nginx Config GeneratorServer blocks for reverse proxies, static sites and PHP, with HTTPS.VPS RAM CalculatorHow much memory a server needs for its OS, apps, databases and caches.Linux Command GeneratorReady-to-run commands for disks, networking, services, logs and diagnostics.
Run VMs for other people?
Frabs stops spam, scans and floods leaving your customers' VMs, before the abuse report lands.