Phase 12

NGINX

NGINX is useful for learning web hosting and serving simple static sites.

1) Create content directory

mkdir -p ~/docker/appdata/nginx/html
printf '<h1>Hello from NGINX</h1>
' > ~/docker/appdata/nginx/html/index.html

2) Docker Compose

Create: ~/docker/compose/core/nginx.compose.yml

services:
  nginx:
    image: nginx:alpine
    container_name: nginx
    ports:
      - "8080:80"
    volumes:
      - ~/docker/appdata/nginx/html:/usr/share/nginx/html:ro
      - ~/docker/appdata/nginx/conf.d:/etc/nginx/conf.d:ro
    restart: unless-stopped
    networks:
      - proxy

networks:
  proxy:
    external: true

Start:

docker compose -f ~/docker/compose/core/nginx.compose.yml up -d

Open:

  • http://<debian-ip>:8080

Next

Proceed to: Torrents


Navigation:Minecraft Server: Crafty (+ Port Forwarding) | Torrents: qBittorrent + VueTorrent + Gluetun