最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Having problems getting a variable from a .env file to work in my docker compose file from a higher directory - Stack Overflow

programmeradmin0浏览0评论

I have my directories set up like this

>
.env
    >unmanic
        compose.yml
    >overseer
        compose.yml

My unmanic compose.yml looks like this

version: "3"
services:
  unmanic:
    container_name: unmanic
    image: josh5/unmanic:latest
    ports:
      - 8888:8888
    restart: unless-stopped
    networks:
      - unabatedshagie
    env_file: /srv/dev-disk-by-uuid-f94e80d8-a1e4-4ee9-8ca1-dbef7eb0d715/_docker_configs/dockge_stacks_optiplex/.env
    volumes:
      - ${DOCKERDATAPATH}/unmanic:/config
      - ${MOVIES}:/movies

more-media networks: unabatedshagie: name: unabatedshagie external: true

My .env file looks like this

PUID=1000
PGID=100
TZ=Europe/London
UMASK=002
DOCKERDATAPATH="/srv/dev-disk-by-uuid-f94e80d8-a1e4-4ee9-8ca1-dbef7eb0d715/_docker_configs"
MOVIES="/srv/dev-disk-by-uuid-680132be-a6e7-4aaa-97be-6759d66ddcfe/movies"

This doesn't work. If I remove the env_file: line and move the .env file into the unmanic folder it does work.

Is what I'm trying to do not possible?

It does seem to work if I'm not trying to reference the paths, the PIUD and PGID's get picked up, which is why it's confusing me.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论