luigi311 / JellyPlex-Watched

Sync watched between jellyfin and plex locally
GNU General Public License v3.0
394 stars 22 forks source link

How to use compose file in portainer? #59

Closed renetsk closed 1 year ago

renetsk commented 1 year ago

Hello, scripts works perfect. Want to create stack in my portainer, how to do that please?

version: "3"
services:
  jellyplex:
    image: luigi311/jellyplex-watched:latest
    container_name: jellyplex
    env_file:
    - /home/user/data/jellyplex/.env:/app/.env
    restart: unless-stopped

Still getting this error

Deployment error
open /home/user/data/jellyplex/.env:/app/.env: no such file or directory 
JChris246 commented 1 year ago

Setting the env file in compose yml with env_file should simply be the path to the env file; try:

env_file:
    - /home/user/data/jellyplex/.env
renetsk commented 1 year ago

tried it, same result. open /home/user/data/jellyplex/.env: no such file or directory

root@home:/home/user/data/jellyplex# ls -la
total 12
drwxr-xr-x  2 root root 4096 Apr  2 10:38 .
drwxr-xr-x 19 root root 4096 Apr  1 12:59 ..
-rw-r--r--  1 root root 2890 Apr  1 12:59 .env
luigi311 commented 1 year ago

I havent used portainer all that much but the following docker compose file does work by itself.

version: '3.1'

services:
  jellyplex-watched:
    image: luigi311/jellyplex-watched:latest
    container_name: jellyplex-watched
    restart: always
    pull_policy: always
    volumes:
      - .env:/app/.env

This also works with env_file assuming your compose file is in the same directory as your .env file so the env_file method does work.

version: '3.1'

services:
  jellyplex-watched:
    image: luigi311/jellyplex-watched:latest
    container_name: jellyplex-watched
    restart: always
    pull_policy: always
    env_file:
      - .env
renetsk commented 1 year ago

first code works fine for me but without pull_policy: always. it's not supported in portainer. Thank you so much.

luigi311 commented 1 year ago

glad its working now, weird that env_file wasnt working though.