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

  1. Create a working directory named after the service.
  2. Copy the compose file and generated `.env` into that directory.
  3. Review the variables and replace placeholders with real values.
  4. Run `docker compose up -d`.
mkdir nginx
cd nginx
# create docker-compose.yml
# create .env
docker compose up -d