TandoorRecipes / recipes

Application for managing recipes, planning meals, building shopping lists and much much more!
https://docs.tandoor.dev
Other
5.35k stars 566 forks source link

Add documentation for Nginx Proxy Manager #1518

Open speendo opened 2 years ago

speendo commented 2 years ago

Documentation link

https://docs.tandoor.dev/install/docker/#reverse-proxy

Affected section

Installation

Other

No response

Issue description

It would be great to have a short section on how to install with Nginx Proxy Manager. Most information should already be available in this issue: https://github.com/TandoorRecipes/recipes/issues/452

Thank you for this great product!

Rgamer84 commented 1 year ago

I beat my head against a wall for a little bit on this. Hopefully this helps someone!

NGINX Proxy Manager Docker Compose:

version: "3.9"
services:
 nginx-proxy-manager:
    container_name: nginx-proxy-manager
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - /docker/npm/data:/data
      - /docker/npm/letsencrypt:/etc/letsencrypt
      - /docker/tandoor/mediafiles:/media

I have my docker files for NGINX Proxy Manager under /docker/npm/. Note that I exposed an additional volume to my tandoor media files folder. I store my media files under /docker/tandoor/mediafiles/ and have it mapped to /media within the nginx proxy manager container. Modify this to meet your environment.

From there you should be able to add your Proxy Host into Nginx Proxy Manager as normal however under advanced you should place in the following under Custom Nginx Configuration:

# serve media files
   location /media {
   alias /media/;
   }

Your images should now load! I didn't include the rest of my docker compose script as you should be able to follow the other general installation examples already written in the existing documentation.

dudeasaurusrex commented 5 months ago

Thank you!! This helped tremendously! Pasting my docker-compose below since I did have to modify a couple of things from the defaults.

db_recipes:
    restart: unless-stopped
    image: postgres:16-alpine
    container_name: tandoor_db
    volumes:
      - $DOCKERDIR/appdata/tandoor/postgresql:/var/lib/postgresql/data
    env_file:
      - $DOCKERDIR/appdata/tandoor/tandoor.env
    networks:
      - npm_proxy

  web_recipes:
    restart: unless-stopped
    image: vabene1111/recipes
    container_name: tandoor_app
    env_file:
      - $DOCKERDIR/appdata/tandoor/tandoor.env
    volumes:
      - $DOCKERDIR/appdata/tandoor/staticfiles:/opt/recipes/staticfiles
      - $DOCKERDIR/appdata/tandoor/mediafiles:/opt/recipes/mediafiles
    depends_on:
      - db_recipes
    ports:
      - 5123:8080
    networks:
      - npm_proxy