添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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 # 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

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!

@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 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

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
          

@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

@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?

# 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 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 ()
          

@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 ()
          

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?

@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"}
          

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": "[email protected]",
    "password": "password"