Build does not work #36

Closed
opened 2026-02-04 16:51:17 +03:00 by OVERLORD · 27 comments
Owner

Originally created by @comfreak89 on GitHub (Mar 30, 2022).

.env file:

# STAGE
NODE_ENV=development

# Database
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_DATABASE_NAME=immich

# Upload File Config
UPLOAD_LOCATION=/mnt/data/Immich

# JWT SECRET
JWT_SECRET=mNQXf1R6S1m7jwvwW82e

# MAPBOX
## ENABLE_MAPBOX is either true of false -> if true, you have to provide MAPBOX_KEY
ENABLE_MAPBOX=false
MAPBOX_KEY=

UPLOAD_LOCATION exists:

root@docker:~/immich/immich-1.4.0-dev# ls -l /mnt/data/Immich/
total 0
root@docker:~/immich/immich-1.4.0-dev# docker-compose -f ./docker/docker-compose.yml up --build -V
WARNING: The UPLOAD_LOCATION variable is not set. Defaulting to a blank string.
WARNING: The DB_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The DB_USERNAME variable is not set. Defaulting to a blank string.
WARNING: The DB_DATABASE_NAME variable is not set. Defaulting to a blank string.
Building immich_microservices
ERROR: forbidden path outside the build context: ../microservices/Dockerfile ()

I dont know why the warnings appear, altough a .env file exists and the variables are filled:

root@docker:~/immich/immich-1.4.0-dev# ls -la docker/.env
-rw-rw-r-- 1 root root 327 Mar 29 23:44 docker/.env
Originally created by @comfreak89 on GitHub (Mar 30, 2022). .env file: ``` # STAGE NODE_ENV=development # Database DB_USERNAME=postgres DB_PASSWORD=postgres DB_DATABASE_NAME=immich # Upload File Config UPLOAD_LOCATION=/mnt/data/Immich # JWT SECRET JWT_SECRET=mNQXf1R6S1m7jwvwW82e # MAPBOX ## ENABLE_MAPBOX is either true of false -> if true, you have to provide MAPBOX_KEY ENABLE_MAPBOX=false MAPBOX_KEY= ``` UPLOAD_LOCATION exists: ``` root@docker:~/immich/immich-1.4.0-dev# ls -l /mnt/data/Immich/ total 0 ``` ``` root@docker:~/immich/immich-1.4.0-dev# docker-compose -f ./docker/docker-compose.yml up --build -V WARNING: The UPLOAD_LOCATION variable is not set. Defaulting to a blank string. WARNING: The DB_PASSWORD variable is not set. Defaulting to a blank string. WARNING: The DB_USERNAME variable is not set. Defaulting to a blank string. WARNING: The DB_DATABASE_NAME variable is not set. Defaulting to a blank string. Building immich_microservices ERROR: forbidden path outside the build context: ../microservices/Dockerfile () ``` I dont know why the warnings appear, altough a .env file exists and the variables are filled: ``` root@docker:~/immich/immich-1.4.0-dev# ls -la docker/.env -rw-rw-r-- 1 root root 327 Mar 29 23:44 docker/.env ```
Author
Owner

@Klutronic commented on GitHub (Mar 30, 2022):

Not seeing the warnings but I am getting the same error:

Building immich_microservices
ERROR: forbidden path outside the build context: ../microservices/Dockerfile ()
@Klutronic commented on GitHub (Mar 30, 2022): Not seeing the warnings but I am getting the same error: Building immich_microservices ERROR: forbidden path outside the build context: ../microservices/Dockerfile ()
Author
Owner

@jrasm91 commented on GitHub (Mar 30, 2022):

Probably need to run the docker-compose command up in the top level directory, instead of inside the docker/ folder.

@jrasm91 commented on GitHub (Mar 30, 2022): Probably need to run the `docker-compose` command up in the top level directory, instead of inside the `docker/` folder.
Author
Owner

@comfreak89 commented on GitHub (Mar 30, 2022):

I did as you can see in my commands. I am not in the docker folder when running the docker-compose command!

@comfreak89 commented on GitHub (Mar 30, 2022): I did as you can see in my commands. I am not in the docker folder when running the docker-compose command!
Author
Owner

@jrasm91 commented on GitHub (Mar 30, 2022):

I did as you can see in my commands. I am not in the docker folder when running the docker-compose command!

Ah, yes I see that now. My bad!

@jrasm91 commented on GitHub (Mar 30, 2022): > I did as you can see in my commands. I am not in the docker folder when running the docker-compose command! Ah, yes I see that now. My bad!
Author
Owner

@alextran1502 commented on GitHub (Mar 30, 2022):

@comfreak89 I see that you downloaded the release, it was having a problem. I am about to push out another release to solve that problem. You can check out the main branch in the meantime to run.

@Klutronic Did you also download and use the release version?

Also what platform are you guys running on?

Edit: I found the problem, I am fixing it

@alextran1502 commented on GitHub (Mar 30, 2022): @comfreak89 I see that you downloaded the release, it was having a problem. I am about to push out another release to solve that problem. You can check out the main branch in the meantime to run. @Klutronic Did you also download and use the release version? Also what platform are you guys running on? Edit: I found the problem, I am fixing it
Author
Owner

@Klutronic commented on GitHub (Mar 30, 2022):

@alextran1502 I cloned the repo to run it

I am on Ubuntu 20.04.2:

immich$ docker-compose -v
docker-compose version 1.25.0, build unknown
immich$ docker -v
Docker version 20.10.7, build 20.10.7-0ubuntu5~20.04.2

@Klutronic commented on GitHub (Mar 30, 2022): @alextran1502 I cloned the repo to run it I am on Ubuntu 20.04.2: immich$ docker-compose -v docker-compose version 1.25.0, build unknown immich$ docker -v Docker version 20.10.7, build 20.10.7-0ubuntu5~20.04.2
Author
Owner

@alextran1502 commented on GitHub (Mar 30, 2022):

Did you install docker with snap? Maybe related to #67

@alextran1502 commented on GitHub (Mar 30, 2022): Did you install docker with `snap`? Maybe related to #67
Author
Owner

@comfreak89 commented on GitHub (Mar 30, 2022):

Hi,

I tried 1.4.0-7-dev and a direct clone of the repository now. Same issue.

Direct clone:

root@docker:~/immich/immich# docker-compose -f ./docker/docker-compose.yml up --build -V
WARNING: The UPLOAD_LOCATION variable is not set. Defaulting to a blank string.
WARNING: The DB_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The DB_USERNAME variable is not set. Defaulting to a blank string.
WARNING: The DB_DATABASE_NAME variable is not set. Defaulting to a blank string.
Building immich_microservices
ERROR: forbidden path outside the build context: ../microservices/Dockerfile ()

1.4.0-7-dev:

root@docker:~/immich/immich-1.4.0-7-dev# docker-compose -f ./docker/docker-compose.yml up --build -V
WARNING: The UPLOAD_LOCATION variable is not set. Defaulting to a blank string.
WARNING: The DB_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The DB_USERNAME variable is not set. Defaulting to a blank string.
WARNING: The DB_DATABASE_NAME variable is not set. Defaulting to a blank string.
Building immich_microservices
ERROR: forbidden path outside the build context: ../microservices/Dockerfile ()

I am still corious why it says, that the variables in the .env are not set, althout it is available:

Direct clone:

root@docker:~/immich/immich# ls -la docker/.env
-rw-r--r-- 1 root root 376 Mar 30 14:13 docker/.env
root@docker:~/immich/immich-1.4.0-7-dev# cat docker/.env
# STAGE
NODE_ENV=development

# Database
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_DATABASE_NAME=immich

# Upload File Config
UPLOAD_LOCATION=/mnt/data/Immich

# JWT SECRET
JWT_SECRET=ganXupoCQdV9rcTiM0DSxDmwP5vCB4UIfeUjhogzr1EpDloucvq2UAQd1bfk

# MAPBOX
## ENABLE_MAPBOX is either true of false -> if true, you have to provide MAPBOX_KEY
ENABLE_MAPBOX=false
MAPBOX_KEY=

1.4.0-7-dev:

root@docker:~/immich/immich-1.4.0-7-dev# ls -la docker/.env
-rw-r--r-- 1 root root 376 Mar 30 14:12 docker/.env
root@docker:~/immich/immich# cat docker/.env
# STAGE
NODE_ENV=development

# Database
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_DATABASE_NAME=immich

# Upload File Config
UPLOAD_LOCATION=/mnt/data/Immich

# JWT SECRET
JWT_SECRET=ganXupoCQdV9rcTiM0DSxDmwP5vCB4UIfeUjhogzr1EpDloucvq2UAQd1bfk

# MAPBOX
## ENABLE_MAPBOX is either true of false -> if true, you have to provide MAPBOX_KEY
ENABLE_MAPBOX=false
MAPBOX_KEY=

No, I installed docker via apt. Snap is not available.

root@docker:~/immich/immich/docker# apt list --installed | grep docker

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

docker-ce-cli/focal,now 5:20.10.12~3-0~ubuntu-focal amd64 [installed,upgradable to: 5:20.10.14~3-0~ubuntu-focal]
docker-ce-rootless-extras/focal,now 5:20.10.12~3-0~ubuntu-focal amd64 [installed,upgradable to: 5:20.10.14~3-0~ubuntu-focal]
docker-ce/focal,now 5:20.10.12~3-0~ubuntu-focal amd64 [installed,upgradable to: 5:20.10.14~3-0~ubuntu-focal]
docker-compose/focal,now 1.25.0-1 all [installed]
docker-scan-plugin/focal,now 0.12.0~ubuntu-focal amd64 [installed,upgradable to: 0.17.0~ubuntu-focal]
python3-docker/focal,now 4.1.0-1 all [installed,automatic]
python3-dockerpty/focal,now 0.4.1-2 all [installed,automatic]
root@docker:~/immich/immich/docker# snap list

Command 'snap' not found, but can be installed with:

apt install snapd

In my case, the host is a LXC Container on the newest Proxmox version:

root@docker:~/immich/immich/docker# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.4 LTS
Release:        20.04
Codename:       focal
root@docker:~/immich/immich/docker# uname -r
5.13.19-4-pve
root@docker:~/immich/immich-1.4.0-7-dev# docker-compose -v
docker-compose version 1.25.5, build 8a1c60f6
root@docker:~/immich/immich-1.4.0-7-dev# docker -v
Docker version 20.10.12, build e91ed57
@comfreak89 commented on GitHub (Mar 30, 2022): Hi, I tried 1.4.0-7-dev and a direct clone of the repository now. Same issue. Direct clone: ``` root@docker:~/immich/immich# docker-compose -f ./docker/docker-compose.yml up --build -V WARNING: The UPLOAD_LOCATION variable is not set. Defaulting to a blank string. WARNING: The DB_PASSWORD variable is not set. Defaulting to a blank string. WARNING: The DB_USERNAME variable is not set. Defaulting to a blank string. WARNING: The DB_DATABASE_NAME variable is not set. Defaulting to a blank string. Building immich_microservices ERROR: forbidden path outside the build context: ../microservices/Dockerfile () ``` 1.4.0-7-dev: ``` root@docker:~/immich/immich-1.4.0-7-dev# docker-compose -f ./docker/docker-compose.yml up --build -V WARNING: The UPLOAD_LOCATION variable is not set. Defaulting to a blank string. WARNING: The DB_PASSWORD variable is not set. Defaulting to a blank string. WARNING: The DB_USERNAME variable is not set. Defaulting to a blank string. WARNING: The DB_DATABASE_NAME variable is not set. Defaulting to a blank string. Building immich_microservices ERROR: forbidden path outside the build context: ../microservices/Dockerfile () ``` I am still corious why it says, that the variables in the .env are not set, althout it is available: Direct clone: ``` root@docker:~/immich/immich# ls -la docker/.env -rw-r--r-- 1 root root 376 Mar 30 14:13 docker/.env root@docker:~/immich/immich-1.4.0-7-dev# cat docker/.env # STAGE NODE_ENV=development # Database DB_USERNAME=postgres DB_PASSWORD=postgres DB_DATABASE_NAME=immich # Upload File Config UPLOAD_LOCATION=/mnt/data/Immich # JWT SECRET JWT_SECRET=ganXupoCQdV9rcTiM0DSxDmwP5vCB4UIfeUjhogzr1EpDloucvq2UAQd1bfk # MAPBOX ## ENABLE_MAPBOX is either true of false -> if true, you have to provide MAPBOX_KEY ENABLE_MAPBOX=false MAPBOX_KEY= ``` 1.4.0-7-dev: ``` root@docker:~/immich/immich-1.4.0-7-dev# ls -la docker/.env -rw-r--r-- 1 root root 376 Mar 30 14:12 docker/.env root@docker:~/immich/immich# cat docker/.env # STAGE NODE_ENV=development # Database DB_USERNAME=postgres DB_PASSWORD=postgres DB_DATABASE_NAME=immich # Upload File Config UPLOAD_LOCATION=/mnt/data/Immich # JWT SECRET JWT_SECRET=ganXupoCQdV9rcTiM0DSxDmwP5vCB4UIfeUjhogzr1EpDloucvq2UAQd1bfk # MAPBOX ## ENABLE_MAPBOX is either true of false -> if true, you have to provide MAPBOX_KEY ENABLE_MAPBOX=false MAPBOX_KEY= ``` No, I installed docker via apt. Snap is not available. ``` root@docker:~/immich/immich/docker# apt list --installed | grep docker WARNING: apt does not have a stable CLI interface. Use with caution in scripts. docker-ce-cli/focal,now 5:20.10.12~3-0~ubuntu-focal amd64 [installed,upgradable to: 5:20.10.14~3-0~ubuntu-focal] docker-ce-rootless-extras/focal,now 5:20.10.12~3-0~ubuntu-focal amd64 [installed,upgradable to: 5:20.10.14~3-0~ubuntu-focal] docker-ce/focal,now 5:20.10.12~3-0~ubuntu-focal amd64 [installed,upgradable to: 5:20.10.14~3-0~ubuntu-focal] docker-compose/focal,now 1.25.0-1 all [installed] docker-scan-plugin/focal,now 0.12.0~ubuntu-focal amd64 [installed,upgradable to: 0.17.0~ubuntu-focal] python3-docker/focal,now 4.1.0-1 all [installed,automatic] python3-dockerpty/focal,now 0.4.1-2 all [installed,automatic] root@docker:~/immich/immich/docker# snap list Command 'snap' not found, but can be installed with: apt install snapd ``` In my case, the host is a LXC Container on the newest Proxmox version: ``` root@docker:~/immich/immich/docker# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.4 LTS Release: 20.04 Codename: focal root@docker:~/immich/immich/docker# uname -r 5.13.19-4-pve root@docker:~/immich/immich-1.4.0-7-dev# docker-compose -v docker-compose version 1.25.5, build 8a1c60f6 root@docker:~/immich/immich-1.4.0-7-dev# docker -v Docker version 20.10.12, build e91ed57 ```
Author
Owner

@alextran1502 commented on GitHub (Mar 30, 2022):

@jrasm91 can you try to run this in a VM instead of LXC. I've had problems running Docker in LXC.

Please take a look at the Known Issue with PromoxVM in the last section of Readme file

@alextran1502 commented on GitHub (Mar 30, 2022): @jrasm91 can you try to run this in a VM instead of LXC. I've had problems running Docker in LXC. Please take a look at the Known Issue with PromoxVM in the last section of Readme file
Author
Owner

@Klutronic commented on GitHub (Mar 30, 2022):

@alextran1502 I installed Docker with APT

@Klutronic commented on GitHub (Mar 30, 2022): @alextran1502 I installed Docker with APT
Author
Owner

@alextran1502 commented on GitHub (Mar 30, 2022):

@Klutronic Are you running this on a VM/LXC or your desktop environment?

@alextran1502 commented on GitHub (Mar 30, 2022): @Klutronic Are you running this on a VM/LXC or your desktop environment?
Author
Owner

@Klutronic commented on GitHub (Mar 30, 2022):

@alextran1502 It's on a physical machine. I can try in a fresh VM if you like.

@Klutronic commented on GitHub (Mar 30, 2022): @alextran1502 It's on a physical machine. I can try in a fresh VM if you like.
Author
Owner

@alextran1502 commented on GitHub (Mar 30, 2022):

@Klutronic Then there shouldn't be any problem. Hmm, this is strange. Can you try to reclone the repo and run it again?

Can you also share your docker-compose and .env file?

@alextran1502 commented on GitHub (Mar 30, 2022): @Klutronic Then there shouldn't be any problem. Hmm, this is strange. Can you try to reclone the repo and run it again? Can you also share your `docker-compose` and `.env` file?
Author
Owner

@Klutronic commented on GitHub (Mar 30, 2022):

.env

# Database
DB_USERNAME=immich
DB_PASSWORD=immich
DB_DATABASE_NAME=immich

# Upload File Config
UPLOAD_LOCATION=/home/<redacted>/docker/immich/backup

# JWT SECRET
JWT_SECRET=<redacted>

# MAPBOX
## ENABLE_MAPBOX is either true of false -> if true, you have to provide MAPBOX_KEY
ENABLE_MAPBOX=false
MAPBOX_KEY=

docker-compose.yml

version: "3.7"

services:
  immich_server:
    image: immich-server:1.4.0
    build:
      context: ../server
      dockerfile: ../server/Dockerfile
    entrypoint: ["/bin/sh", "./entrypoint.sh"]
    expose:
      - "3000"
    volumes:
      - ../server:/usr/src/app
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /usr/src/app/node_modules
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    depends_on:
      - redis
      - database
    networks:
      - immich_network

  immich_microservices:
    image: immich-microservices:1.4.0
    build:
      context: ../microservices
      dockerfile: ../microservices/Dockerfile
    entrypoint: ["/bin/sh", "./entrypoint.sh"]
    expose:
      - "3001"
    volumes:
      - ../microservices:/usr/src/app
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /usr/src/app/node_modules
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    depends_on:
      - database
    networks:
      - immich_network


  redis:
    container_name: immich_redis
    image: redis:6.2
    networks:
      - immich_network

  database:
    container_name: immich_postgres
    image: postgres:14
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      PG_DATA: /var/lib/postgresql/data
    volumes:
      - pgdata:/var/lib/postgresql/data
    ports:
      - 5432:5432
    networks:
      - immich_network

  nginx:
    container_name: proxy_nginx
    image: nginx:latest
    volumes:
      - ./settings/nginx-conf:/etc/nginx/conf.d
    ports:
      - 2283:80
      - 2284:443
    logging:
      driver: none
    networks:
      - immich_network
    depends_on:
      - immich_server

  # immich_tf_fastapi:
  #   container_name: immich_tf_fastapi
  #   image: tensor_flow_fastapi:1.0.0
  #   restart: always
  #   command: uvicorn app.main:app --proxy-headers --host 0.0.0.0 --port 8000 --reload
  #   build:
  #     context: ../machine_learning
  #     target: cpu
  #     dockerfile: ../machine_learning/Dockerfile
  #   volumes:
  #     - ../machine_learning/app:/code/app
  #     - ${UPLOAD_LOCATION}:/code/app/upload
  #   ports:
  #     - 2285:8000
  #   expose:
  #     - "8000"
  #   depends_on:
  #     - database
  #   networks:
  #     - immich_network

networks:
  immich_network:
volumes:
  pgdata:

I re-cloned and got the same error message with the warnings for the variables not being present.

However, I DO NOT get the variable warnings if I run the docker-compose command from the ../docker folder

@Klutronic commented on GitHub (Mar 30, 2022): .env # Database DB_USERNAME=immich DB_PASSWORD=immich DB_DATABASE_NAME=immich # Upload File Config UPLOAD_LOCATION=/home/<redacted>/docker/immich/backup # JWT SECRET JWT_SECRET=<redacted> # MAPBOX ## ENABLE_MAPBOX is either true of false -> if true, you have to provide MAPBOX_KEY ENABLE_MAPBOX=false MAPBOX_KEY= docker-compose.yml version: "3.7" services: immich_server: image: immich-server:1.4.0 build: context: ../server dockerfile: ../server/Dockerfile entrypoint: ["/bin/sh", "./entrypoint.sh"] expose: - "3000" volumes: - ../server:/usr/src/app - ${UPLOAD_LOCATION}:/usr/src/app/upload - /usr/src/app/node_modules env_file: - .env environment: - NODE_ENV=production depends_on: - redis - database networks: - immich_network immich_microservices: image: immich-microservices:1.4.0 build: context: ../microservices dockerfile: ../microservices/Dockerfile entrypoint: ["/bin/sh", "./entrypoint.sh"] expose: - "3001" volumes: - ../microservices:/usr/src/app - ${UPLOAD_LOCATION}:/usr/src/app/upload - /usr/src/app/node_modules env_file: - .env environment: - NODE_ENV=production depends_on: - database networks: - immich_network redis: container_name: immich_redis image: redis:6.2 networks: - immich_network database: container_name: immich_postgres image: postgres:14 env_file: - .env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} PG_DATA: /var/lib/postgresql/data volumes: - pgdata:/var/lib/postgresql/data ports: - 5432:5432 networks: - immich_network nginx: container_name: proxy_nginx image: nginx:latest volumes: - ./settings/nginx-conf:/etc/nginx/conf.d ports: - 2283:80 - 2284:443 logging: driver: none networks: - immich_network depends_on: - immich_server # immich_tf_fastapi: # container_name: immich_tf_fastapi # image: tensor_flow_fastapi:1.0.0 # restart: always # command: uvicorn app.main:app --proxy-headers --host 0.0.0.0 --port 8000 --reload # build: # context: ../machine_learning # target: cpu # dockerfile: ../machine_learning/Dockerfile # volumes: # - ../machine_learning/app:/code/app # - ${UPLOAD_LOCATION}:/code/app/upload # ports: # - 2285:8000 # expose: # - "8000" # depends_on: # - database # networks: # - immich_network networks: immich_network: volumes: pgdata: I re-cloned and got the same error message with the warnings for the variables not being present. However, I DO NOT get the variable warnings if I run the docker-compose command from the ../docker folder
Author
Owner

@alextran1502 commented on GitHub (Mar 30, 2022):

@Klutronic Is there a reason you changed the version from 3.8 to 3.7?

Can you try commenting out the immich_microservices section to see if it makes any difference?

@alextran1502 commented on GitHub (Mar 30, 2022): @Klutronic Is there a reason you changed the version from 3.8 to 3.7? Can you try commenting out the `immich_microservices` section to see if it makes any difference?
Author
Owner

@comfreak89 commented on GitHub (Mar 30, 2022):

....yeaaahhh...okay...it works in a Proxmox VM with CPU flag "host"...

...just wondering: it worked in that LXC container before for me...

@comfreak89 commented on GitHub (Mar 30, 2022): ....yeaaahhh...okay...it works in a Proxmox VM with CPU flag "host"... ...just wondering: it worked in that LXC container before for me...
Author
Owner

@comfreak89 commented on GitHub (Mar 30, 2022):

@Klutronic Is there a reason you changed the version from 3.8 to 3.7?

Can you try commenting out the immich_microservices section to see if it makes any difference?

I also tried that. No difference in the LXC Container despite that it tries to build the immich_server:

root@docker:~/immich/immich# docker-compose -f ./docker/docker-compose.yml up --build -V --force-recreate
WARNING: The UPLOAD_LOCATION variable is not set. Defaulting to a blank string.
WARNING: The DB_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The DB_USERNAME variable is not set. Defaulting to a blank string.
WARNING: The DB_DATABASE_NAME variable is not set. Defaulting to a blank string.
Creating network "docker_immich_network" with the default driver
Creating volume "docker_pgdata" with default driver
Building immich_server
ERROR: forbidden path outside the build context: ../server/Dockerfile ()
@comfreak89 commented on GitHub (Mar 30, 2022): > @Klutronic Is there a reason you changed the version from 3.8 to 3.7? > > Can you try commenting out the `immich_microservices` section to see if it makes any difference? I also tried that. No difference in the LXC Container despite that it tries to build the immich_server: ``` root@docker:~/immich/immich# docker-compose -f ./docker/docker-compose.yml up --build -V --force-recreate WARNING: The UPLOAD_LOCATION variable is not set. Defaulting to a blank string. WARNING: The DB_PASSWORD variable is not set. Defaulting to a blank string. WARNING: The DB_USERNAME variable is not set. Defaulting to a blank string. WARNING: The DB_DATABASE_NAME variable is not set. Defaulting to a blank string. Creating network "docker_immich_network" with the default driver Creating volume "docker_pgdata" with default driver Building immich_server ERROR: forbidden path outside the build context: ../server/Dockerfile () ```
Author
Owner

@alextran1502 commented on GitHub (Mar 30, 2022):

@comfreak89 Yeah, so it would probably be a problem with LXC then. Strange!

@alextran1502 commented on GitHub (Mar 30, 2022): @comfreak89 Yeah, so it would probably be a problem with LXC then. Strange!
Author
Owner

@Klutronic commented on GitHub (Mar 30, 2022):

@alextran1502 Yes, I am not on a version of docker-compose that supports 3.8 so I went down to 3.7.

After commenting out the immich_microservices:

sudo docker-compose -f ./docker/docker-compose.yml up --build -V
WARNING: The UPLOAD_LOCATION variable is not set. Defaulting to a blank string.
WARNING: The DB_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The DB_USERNAME variable is not set. Defaulting to a blank string.
WARNING: The DB_DATABASE_NAME variable is not set. Defaulting to a blank string.
Building immich_server
ERROR: forbidden path outside the build context: ../server/Dockerfile ()
@Klutronic commented on GitHub (Mar 30, 2022): @alextran1502 Yes, I am not on a version of docker-compose that supports 3.8 so I went down to 3.7. After commenting out the immich_microservices: sudo docker-compose -f ./docker/docker-compose.yml up --build -V WARNING: The UPLOAD_LOCATION variable is not set. Defaulting to a blank string. WARNING: The DB_PASSWORD variable is not set. Defaulting to a blank string. WARNING: The DB_USERNAME variable is not set. Defaulting to a blank string. WARNING: The DB_DATABASE_NAME variable is not set. Defaulting to a blank string. Building immich_server ERROR: forbidden path outside the build context: ../server/Dockerfile ()
Author
Owner

@comfreak89 commented on GitHub (Mar 30, 2022):

So, I managed it to get it working. I have practicly no knowledge about writing docker files or docker-compose.yml files. Although, these were my steps to get it working in a Proxmox LXC Container AND VM with the same config/command!

Change the docker/docker-compose.yml file to:

version: "3.8"

services:
  immich_server:
    image: immich-server:1.4.0
    build:
      context: ../server
      dockerfile: Dockerfile
    entrypoint: ["/bin/sh", "./entrypoint.sh"]
    expose:
      - "3000"
    volumes:
      - ../server:/usr/src/app
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /usr/src/app/node_modules
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    depends_on:
      - redis
      - database
    networks:
      - immich_network

  immich_microservices:
    image: immich-microservices:1.4.0
    build:
      context: ../microservices
      dockerfile: Dockerfile
    entrypoint: ["/bin/sh", "./entrypoint.sh"]
    expose:
      - "3001"
    volumes:
      - ../microservices:/usr/src/app
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /usr/src/app/node_modules
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    depends_on:
      - database
    networks:
      - immich_network
redis:
    container_name: immich_redis
    image: redis:6.2
    networks:
      - immich_network

  database:
    container_name: immich_postgres
    image: postgres:14
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      PG_DATA: /var/lib/postgresql/data
    volumes:
      - pgdata:/var/lib/postgresql/data
    ports:
      - 5432:5432
    networks:
      - immich_network

  nginx:
    container_name: proxy_nginx
    image: nginx:latest
    volumes:
      - ./settings/nginx-conf:/etc/nginx/conf.d
    ports:
      - 2283:80
      - 2284:443
    logging:
      driver: none
    networks:
      - immich_network
    depends_on:
      - immich_server
# immich_tf_fastapi:
  #   container_name: immich_tf_fastapi
  #   image: tensor_flow_fastapi:1.0.0
  #   restart: always
  #   command: uvicorn app.main:app --proxy-headers --host 0.0.0.0 --port 8000 --reload
  #   build:
  #     context: ../machine_learning
  #     target: cpu
  #     dockerfile: ../machine_learning/Dockerfile
  #   volumes:
  #     - ../machine_learning/app:/code/app
  #     - ${UPLOAD_LOCATION}:/code/app/upload
  #   ports:
  #     - 2285:8000
  #   expose:
  #     - "8000"
  #   depends_on:
  #     - database
  #   networks:
  #     - immich_network

networks:
  immich_network:
volumes:
  pgdata:

Basicly, what I have changed is the path to the Dockerfile

dockerfile: ../server/Dockerfile => dockerfile: Dockerfile
dockerfile: ../microservices/Dockerfile => dockerfile: Dockerfile

Now docker is fine with the context.

To get rid of the WARNINGS, add the path to the .env file in the docker-compose command as follows:

docker-compose --env-file ./docker/.env -f ./docker/docker-compose.yml up --build -V

@alextran1502: As this solution works for me also in a VM, maybe this one is a more compatible/complete solution for other systems?

@comfreak89 commented on GitHub (Mar 30, 2022): So, I managed it to get it working. I have practicly no knowledge about writing docker files or docker-compose.yml files. Although, these were my steps to get it working in a Proxmox LXC Container AND VM with the same config/command! Change the docker/docker-compose.yml file to: ``` version: "3.8" services: immich_server: image: immich-server:1.4.0 build: context: ../server dockerfile: Dockerfile entrypoint: ["/bin/sh", "./entrypoint.sh"] expose: - "3000" volumes: - ../server:/usr/src/app - ${UPLOAD_LOCATION}:/usr/src/app/upload - /usr/src/app/node_modules env_file: - .env environment: - NODE_ENV=production depends_on: - redis - database networks: - immich_network immich_microservices: image: immich-microservices:1.4.0 build: context: ../microservices dockerfile: Dockerfile entrypoint: ["/bin/sh", "./entrypoint.sh"] expose: - "3001" volumes: - ../microservices:/usr/src/app - ${UPLOAD_LOCATION}:/usr/src/app/upload - /usr/src/app/node_modules env_file: - .env environment: - NODE_ENV=production depends_on: - database networks: - immich_network redis: container_name: immich_redis image: redis:6.2 networks: - immich_network database: container_name: immich_postgres image: postgres:14 env_file: - .env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} PG_DATA: /var/lib/postgresql/data volumes: - pgdata:/var/lib/postgresql/data ports: - 5432:5432 networks: - immich_network nginx: container_name: proxy_nginx image: nginx:latest volumes: - ./settings/nginx-conf:/etc/nginx/conf.d ports: - 2283:80 - 2284:443 logging: driver: none networks: - immich_network depends_on: - immich_server # immich_tf_fastapi: # container_name: immich_tf_fastapi # image: tensor_flow_fastapi:1.0.0 # restart: always # command: uvicorn app.main:app --proxy-headers --host 0.0.0.0 --port 8000 --reload # build: # context: ../machine_learning # target: cpu # dockerfile: ../machine_learning/Dockerfile # volumes: # - ../machine_learning/app:/code/app # - ${UPLOAD_LOCATION}:/code/app/upload # ports: # - 2285:8000 # expose: # - "8000" # depends_on: # - database # networks: # - immich_network networks: immich_network: volumes: pgdata: ``` Basicly, what I have changed is the path to the Dockerfile `dockerfile: ../server/Dockerfile` => `dockerfile: Dockerfile` `dockerfile: ../microservices/Dockerfile` => `dockerfile: Dockerfile` Now docker is fine with the context. To get rid of the WARNINGS, add the path to the .env file in the docker-compose command as follows: `docker-compose --env-file ./docker/.env -f ./docker/docker-compose.yml up --build -V` @alextran1502: As this solution works for me also in a VM, maybe this one is a more compatible/complete solution for other systems?
Author
Owner

@alextran1502 commented on GitHub (Mar 30, 2022):

@comfreak89 Yes, I think your proposal is better. I will add them in future updates.

@Klutronic Can you try the solution proposed by @comfreak89 above?

@alextran1502 commented on GitHub (Mar 30, 2022): @comfreak89 Yes, I think your proposal is better. I will add them in future updates. @Klutronic Can you try the solution proposed by @comfreak89 above?
Author
Owner

@Klutronic commented on GitHub (Mar 30, 2022):

@alextran1502 It seems to be up and running but I am getting the following error when I try to go to the site:

{"statusCode":404,"message":"Cannot GET /","error":"Not Found"}
@Klutronic commented on GitHub (Mar 30, 2022): @alextran1502 It seems to be up and running but I am getting the following error when I try to go to the site: {"statusCode":404,"message":"Cannot GET /","error":"Not Found"}
Author
Owner

@comfreak89 commented on GitHub (Mar 30, 2022):

Great!

The error is absolutely correct - there is no WebUI right now. You have to create a user with the curl command and from there on you can use the mobile app.

Change IP, email and password to your needs:

curl --location --request POST 'http://your-server-ip:2283/auth/signUp' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "testuser@email.com",
    "password": "password"
}'
@comfreak89 commented on GitHub (Mar 30, 2022): Great! The error is absolutely correct - there is no WebUI right now. You have to create a user with the curl command and from there on you can use the mobile app. Change IP, email and password to your needs: ``` curl --location --request POST 'http://your-server-ip:2283/auth/signUp' \ --header 'Content-Type: application/json' \ --data-raw '{ "email": "testuser@email.com", "password": "password" }' ```
Author
Owner

@alextran1502 commented on GitHub (Mar 30, 2022):

@Klutronic You will need the mobile app (since this application is for mobile's media file backup), there is no web interface just yet

@alextran1502 commented on GitHub (Mar 30, 2022): @Klutronic You will need the mobile app (since this application is for mobile's media file backup), there is no web interface just yet
Author
Owner

@Klutronic commented on GitHub (Mar 30, 2022):

Ahhhhhh, OK! I created the user already so I am good to go! Thanks guys, I really appreciate the help!

@Klutronic commented on GitHub (Mar 30, 2022): Ahhhhhh, OK! I created the user already so I am good to go! Thanks guys, I really appreciate the help!
Author
Owner

@alextran1502 commented on GitHub (Mar 30, 2022):

Thanks, @comfreak89 and @Klutronic for improving the project :) cheers!

@alextran1502 commented on GitHub (Mar 30, 2022): Thanks, @comfreak89 and @Klutronic for improving the project :) cheers!
Author
Owner

@amatorkoleksiyoner commented on GitHub (Mar 23, 2025):

I had same error. My postgres password had . in it. I removed it in pgAdmin then errors gone.

@amatorkoleksiyoner commented on GitHub (Mar 23, 2025): I had same error. My postgres password had . in it. I removed it in pgAdmin then errors gone.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#36