Nginx
Lightweight Nginx web server starter with a persistent static content volume.
yaml
docker-compose.yml
services:
nginx:
image: nginx:1-alpine
restart: unless-stopped
ports:
- ${NGINX_PORT}:80
volumes:
- nginx_data:/usr/share/nginx/html
volumes:
nginx_data:
.ENV
.env example
NGINX_PORT=8080
deployment
Quick Start
- Create a working directory named after the service.
- Copy the compose file and generated `.env` into that directory.
- Review the variables and replace placeholders with real values.
- Run `docker compose up -d`.
mkdir nginx
cd nginx
# create docker-compose.yml
# create .env
docker compose up -d