Hi all!
I am looking at trying to get NPM - NGINX proxy manager working, and for the life of me cant get it working.
git is installed, and i have tried with #master and without, still no luck, so now i am trying here.
maybe i am going the wrong way here? I just want to add NPM to my container list.
cheers
here is my stack config for portainer, or otherwise known as docker-compose.yml if you prefer that route. I added notes after # for reminders for myself, maybe they help you.
Portainer -> Stacks -> Add Stack:
Name: nginx-pm
Paste this in web editor:
####################################################################################
####################################################################################
#
# Docker Compose File: NGINX Proxy Manager
# Function: Reverse Proxy
#
# Documentation: https://nginxproxymanager.com/setup/#running-the-app
#
#
# Updating NGINX? Make sure to backup v1/data + v1/letsencrypt from Ubuntu VM,
# then make sure volume mapping reflects v1 data, not v2/v3 as it creates
# new ones every update/redeployment. It's bugged.
####################################################################################
####################################################################################
version: '3.8'
services:
app:
container_name: nginx-pm
image: 'jc21/nginx-proxy-manager:latest'
environment:
- PGID=1000 #echo $GID to get this
- PUID=1000 #echo $UID to get this
ports:
- '80:80'
- '81:81'
- '443:443'
volumes:
- /home/YourUSERNAMEHere/data/nginx-pm:/data #host:container mapping
- /home/YourUSERNAMEHere/data/nginx-pm/letsencrypt:/etc/letsencrypt #host:container
logging:
driver: "json-file"
options:
max-file: "10"
max-size: "200k"
restart: unless-stopped
I would suggest to use the editor and copy paste the sample code. You need to adjust it to your environment though…
Alternative look for a ready template for portainer stacks…
I haven’t used git link or anything but my process involved using the image you have. Publishing ports 80,81, 443. And creating directories for data and letsencrypt and mapping those volumes. There are a couple of pretty straightforward videos on YouTube
You shouldn’t need to build the image - the image already exists on Docker Hub. What you want to do is create a container (or stack) that uses the existing image on Docker Hub. Here’s a slightly modified version of the stack file from the NPM documentation that you can deploy in Portainer (the only change I’ve made is to turn the relative path bind mounts into named volumes):
version: '3.8' services: app: image: 'jc21/nginx-proxy-manager:latest' restart: unless-stopped ports: - '80:80' - '443:443' - '81:81' volumes: - data:/data - letsencrypt:/etc/letsencrypt volumes: data: letsencrypt:
In Portainer, go to Stacks, click Add stack, give the stack a name, then paste this into the Web editor and deploy.
Building an image is generally reserved for when you are either creating an image from scratch or are extending an existing image with your own modifications. Simply deploying a container from an image that someone else has created doesn’t require any image building.