name: compose-lesson

services:
  page:
    image: docker.io/nginxinc/nginx-unprivileged:stable-alpine@sha256:9b87ad3dd9f431c733f19dfb278c7eb3dba9dca381942c79818bb42f1a566a83
    restart: "no"
    read_only: true
    cap_drop: ["ALL"]
    security_opt:
      - no-new-privileges:true
    pids_limit: 64
    cpus: 0.25
    mem_limit: 128m
    tmpfs:
      - /tmp:rw,noexec,nosuid,nodev,size=16m
    ports:
      - "127.0.0.1:18080:8080"
    networks: [lesson]
    healthcheck:
      test: ["CMD-SHELL", "wget -q -O /dev/null http://127.0.0.1:8080/ || exit 1"]
      interval: 5s
      timeout: 2s
      retries: 6
      start_period: 5s

networks:
  lesson:
    internal: true
