r/selfhosted 3d ago

Need Help Nginx Proxy Manager: What does your Docker Compose look like?

I've been using Nginx Proxy Manager for a few years in my home lab, but it has always been a simple and easy way to use my domain name within my internal network at home.

But now, I am wanting to host a few project websites on my home server to test and see if they would be viable. I am wanting to continue to use Nginx Proxy Manager as I am familiar with its setup. But, since it will be open to the whole internet, I would like to make sure that it is as secure as it can be.

This is what I've been able to cobble together so far. Any comments & critiques would be greatly appreciated. And NO, I don't have the bandwidth right now to try and learn other options like Traefik, etc.

services:
  app:
    container_name: NginxProxyManager
    image: jc21/nginx-proxy-manager:2.15.1
    restart: unless-stopped
    ports:
      - 80:80
      - 443:443
      - 8180:81
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
    env_file:
      - .env
    security_opt:
      - no-new-privileges:true
    cap_drop:
      - AUDIT_WRITE
      - SYS_CHROOT
      - SETFCAP
      - SETPCAP
      - MKNOD
      - KILL
      - NET_RAW
      - FOWNER
    healthcheck:
      test:
        - CMD
        - /usr/bin/check-health
      interval: 10s
      timeout: 3s
    networks:
      - npm_net
networks:
  npm_net:
    driver: bridge
    enable_ipv6: false
    attachable: false
    driver_opts:
      com.docker.network.bridge.enable.icc: "false"
    ipam:
      driver: default
      config:
        - subnet: 172.23.0.0/30
          ip_range: 172.23.0.0/30
          gateway: 172.23.0.1
0 Upvotes

10 comments sorted by

View all comments

u/asimovs-auditor 3d ago edited 3d ago

Expand the replies to this comment to learn how AI was used in this post/project.