Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use compose file in portainer? #59

Closed
renetsk opened this issue Apr 1, 2023 · 5 comments
Closed

How to use compose file in portainer? #59

renetsk opened this issue Apr 1, 2023 · 5 comments

Comments

@renetsk
Copy link

renetsk commented Apr 1, 2023

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
Copy link
Contributor

JChris246 commented Apr 1, 2023

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
Copy link
Author

renetsk commented Apr 2, 2023

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
Copy link
Owner

luigi311 commented Apr 2, 2023

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
Copy link
Author

renetsk commented Apr 2, 2023

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

@renetsk renetsk closed this as completed Apr 2, 2023
@luigi311
Copy link
Owner

luigi311 commented Apr 2, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants