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

Added one-click-app Immich (open source Google Photos replacement) #893

Closed
wants to merge 16 commits into from
Closed

Conversation

borjarobert
Copy link
Contributor

First of all, thank you for your contribution! 😄

Please note that this repo is mostly for popular apps with thousands of stars and tens of thousands of downloads. If you'd like to add a less popular app, you can always create your own 3rd party repo and add your app there.

☑️ Self Check before Merge

  • I have tested the template using the method described in README.md thoroughly
  • I have ensured that I put as much default values as possible (except passwords) to ensure minimum effort required for end users to get started.
  • I have ensured that I am not using the "latest" tag as this tag is dynamically changing and might break the one-click app. Use a fixed version.
  • I have made sure that instructions.start and instructions.end are clear and self-explanatory.
  • Icon is added as a png file to the logos directory.

@githubsaturn
Copy link
Collaborator

@borjarobert - can you please revert the changes in package-lock.json?

@borjarobert
Copy link
Contributor Author

I think it is ready now. Sorry for the unnecesary commits and the messing with the package.json. I'm so used to git add -A I didn't remember to stage only the needed files.

I can redo the whole PR if you prefer.

@borjarobert borjarobert closed this Apr 1, 2023
@borjarobert
Copy link
Contributor Author

Sorry. I'm doing a new PR. This went too bad

@borjarobert borjarobert reopened this Apr 1, 2023
borjarobert and others added 3 commits April 1, 2023 08:42
I just copy pasted the original, I'm going mad 😱
Copy pasted from the one in master
@borjarobert
Copy link
Contributor Author

Ok, finally! So sorry for the stupid commits. I'll be learning git asap. It should be ready now. Thanks

@borjarobert
Copy link
Contributor Author

It doesn't work. I'll redo it. Sorry

@borjarobert borjarobert closed this Apr 1, 2023
@borjarobert borjarobert deleted the immich branch April 1, 2023 12:17
@arthuragone
Copy link

Just tried it, few minutes ago, and works like a charm. Thank you !

@nirjhar
Copy link

nirjhar commented Jan 7, 2024

Latest build is not working. Can someone please fix/help?

@borjarobert
Copy link
Contributor Author

I'll send a PR with an updated recipe asap. I need some time for testing

@nirjhar
Copy link

nirjhar commented Jan 7, 2024

captainVersion: 4

services:
$$cap_appname-server:
caproverExtra:
notExposeAsWebApp: 'true'
dockerfileLines:
- FROM ghcr.io/immich-app/immich-server:$$cap_version
- ENTRYPOINT ["/bin/sh", "./start-server.sh"]
environment:
NODE_ENV: production
DB_PASSWORD: $$cap_app_db_pass
DB_USERNAME: $$cap_app_db_user
DB_DATABASE_NAME: $$cap_app_db_name
DB_HOSTNAME: srv-captain--$$cap_appname-db
TYPESENSE_API_KEY: $$cap_typesense_api_key
TYPESENSE_HOST: srv-captain--$$cap_appname-typesense
REDIS_HOSTNAME: srv-captain--$$cap_appname-redis
UPLOAD_LOCATION: $$cap_app_upload_location
IMMICH_SERVER_URL: http://srv-captain--$$cap_appname-server:2283
IMMICH_MACHINE_LEARNING_URL: http://srv-captain--$$cap_appname-machine-learning:3003
volumes:
- $$cap_app_upload_location:/usr/src/app/upload
ports:
- "2283:2283" # Mapping container's 2283 port to host's 2283 port
depends_on:
- $$cap_appname-redis
- $$cap_appname-db
- $$cap_appname-typesense

$$cap_appname-microservices:
    caproverExtra:
        notExposeAsWebApp: 'true'
        dockerfileLines:
            - FROM ghcr.io/immich-app/immich-server:$$cap_version
            - ENTRYPOINT ["/bin/sh", "./start-microservices.sh"]
    environment:
        NODE_ENV: production
        DB_PASSWORD: $$cap_app_db_pass
        DB_USERNAME: $$cap_app_db_user
        DB_DATABASE_NAME: $$cap_app_db_name
        DB_HOSTNAME: srv-captain--$$cap_appname-db
        TYPESENSE_API_KEY: $$cap_typesense_api_key
        TYPESENSE_HOST: srv-captain--$$cap_appname-typesense
        REDIS_HOSTNAME: srv-captain--$$cap_appname-redis
        UPLOAD_LOCATION: $$cap_app_upload_location
        IMMICH_SERVER_URL: http://srv-captain--$$cap_appname-server:2283
        IMMICH_MACHINE_LEARNING_URL: http://srv-captain--$$cap_appname-machine-learning:3003
    volumes:
        - $$cap_app_upload_location:/usr/src/app/upload
    depends_on:
        - $$cap_appname-redis
        - $$cap_appname-db
        - $$cap_appname-typesense

$$cap_appname-machine-learning:
    caproverExtra:
        notExposeAsWebApp: 'true'
    image: ghcr.io/immich-app/immich-machine-learning:$$cap_version
    environment:
        NODE_ENV: production
        DB_PASSWORD: $$cap_app_db_pass
        DB_USERNAME: $$cap_app_db_user
        DB_DATABASE_NAME: $$cap_app_db_name
        DB_HOSTNAME: srv-captain--$$cap_appname-db
        TYPESENSE_API_KEY: $$cap_typesense_api_key
        TYPESENSE_HOST: srv-captain--$$cap_appname-typesense
        REDIS_HOSTNAME: srv-captain--$$cap_appname-redis
        UPLOAD_LOCATION: $$cap_app_upload_location
        IMMICH_SERVER_URL: http://srv-captain--$$cap_appname-server:3001
        IMMICH_MACHINE_LEARNING_URL: http://srv-captain--$$cap_appname-machine-learning:3003
    volumes:
        - $$cap_app_upload_location:/usr/src/app/upload
        - $$cap_appname-mlcache:/cache

$$cap_appname-typesense:
    caproverExtra:
        notExposeAsWebApp: 'true'
    image: typesense/typesense:$$cap_typesense_ver
    environment:
        TYPESENSE_API_KEY: $$cap_typesense_api_key
        TYPESENSE_DATA_DIR: '/data'
    volumes:
        - $$cap_appname-typesense-data:/data

$$cap_appname-redis:
    caproverExtra:
        notExposeAsWebApp: 'true'
    image: redis:$$cap_redis_ver

$$cap_appname-db:
    caproverExtra:
        notExposeAsWebApp: 'true'
    image: postgres:$$cap_app_db_ver
    environment:
        POSTGRES_PASSWORD: $$cap_app_db_pass
        POSTGRES_USER: $$cap_app_db_user
        POSTGRES_DB: $$cap_app_db_name
        PG_DATA: /var/lib/postgresql/data
    volumes:
        - $$cap_appname-db-data:/var/lib/postgresql/data

caproverOneClickApp:
displayName: Immich
description: Open source (MIT License) Google Photos alternative. Backup your phone's photos and videos to your private server.
isOfficial: false
documentation: https://immich.app
instructions:
start: |-
Leave every default value as is for a working and simple installation. You can specify the (full) path to the directory you want to save your media, in that case the directory must exist beforehand. Immich can be accessed via browser and with an app (Immich). If you have big media files (bigger than 500MB) in your phone, update your Nginx configuration to increase your client_max_body_size.
end: |-
On your first visit it will ask for email and password for the admin user. Remember to change the default Nginx configuration and increasing the 'client_max_body_size' value if you expect to upload files bigger than 500MB.
variables:
- label: Immich version
id: $$cap_version
description: Check out their valid tags at https://hub.docker.com/r/immich-app/immich/tags
defaultValue: v1.52.1
- label: Immich redis version
id: $$cap_redis_ver
defaultValue: 6.2
description: Check out their valid tags at https://hub.docker.com/_/redis/tags
- label: Typesense version
id: $$cap_typesense_ver
description: Check out their valid tags at https://hub.docker.com/r/typesense/typesense/tags
defaultValue: 0.24.0
- label: Typesense API key
id: $$cap_typesense_api_key
description: A big enough string to be used to authenticate against Typesense. A random one is generated for you.
defaultValue: $$cap_gen_random_hex(32)
- label: Database password
id: $$cap_app_db_pass
description: Password for accessing the database. A random one has been generated for you.
defaultValue: $$cap_gen_random_hex(32)
- label: Database username
id: $$cap_app_db_user
description: Username to access the database
defaultValue: 'immich'
- label: Database name
id: $$cap_app_db_name
description: A name for the database used by Immich
defaultValue: 'immich'
- label: PostgreSQL database version
id: $$cap_app_db_ver
description: Immich uses PostgreSQL as a database. Check out their valid tags at https://hub.docker.com/_/postgres/tags
defaultValue: 14
- label: Upload directory
id: $$cap_app_upload_location
description: Full path to the directory where you plan to store all your files. It should be created beforehand. If you want caprover to create it for you just leave the default 'immich-data'
defaultValue: immich-data

@nirjhar
Copy link

nirjhar commented Jan 7, 2024

Also please change the default values to 'release' for immich and 'latest' for redis. For psql 'tensorchord/pgvecto-rs:pg14-v0.1.11' otherwise it won't run.

@nirjhar
Copy link

nirjhar commented Jan 7, 2024

@borjarobert latest version already removed two pods. See. immich-app/immich#5086

@nirjhar
Copy link

nirjhar commented Jan 7, 2024

@borjarobert also please check the android/ios app is working or not with the endpoint. Thanks in dvance.

@nirjhar
Copy link

nirjhar commented Jan 9, 2024

@borjarobert any update?

@borjarobert
Copy link
Contributor Author

PR #1054 sent!

@borjarobert
Copy link
Contributor Author

Also please change the default values to 'release' for immich and 'latest' for redis. For psql 'tensorchord/pgvecto-rs:pg14-v0.1.11' otherwise it won't run.

As per caprover rules, it should be tied to a single version and not latest or, in this case, release.

release would have broken the recipe on v1.91.0. Cheers

@nirjhar
Copy link

nirjhar commented Jan 14, 2024

PR #1054 sent!

When they will pull it? I don't know about their repo management. Please let us know.

@borjarobert
Copy link
Contributor Author

I don't know. But if you're on a rush, you can always copy the text of the recipe, paste it in a Template and get going.

In your caprover instance click on 'One-Click Apps/Databases' button. Then search for the 'Template' one, and paste the result of my PR inside. Click 'next' and follow the instructions as if it were any other One-Click App.

captainVersion: 4

services:
    $$cap_appname:
        caproverExtra:
            dockerfileLines:
                - FROM ghcr.io/immich-app/immich-server:$$cap_version
                - CMD ["start.sh", "immich"]
            containerHttpPort: 3001
        environment:
            DB_PASSWORD: $$cap_app_db_pass
            DB_USERNAME: $$cap_app_db_user
            DB_DATABASE_NAME: $$cap_app_db_name
            DB_HOSTNAME: srv-captain--$$cap_appname-db
            REDIS_HOSTNAME: srv-captain--$$cap_appname-redis
            UPLOAD_LOCATION: $$cap_app_upload_location
            IMMICH_MACHINE_LEARNING_URL: http://srv-captain--$$cap_appname-machine-learning:3003
        volumes:
            - $$cap_app_upload_location:/usr/src/app/upload
            - /etc/localtime:/etc/localtime:ro
        depends_on:
            - $$cap_appname-redis
            - $$cap_appname-db

    $$cap_appname-microservices:
        caproverExtra:
            notExposeAsWebApp: 'true'
            dockerfileLines:
                - FROM ghcr.io/immich-app/immich-server:$$cap_version
                - CMD ["start.sh", "microservices"]
                # - ENTRYPOINT ["/bin/sh", "./start-microservices.sh"] Changed for v1.58.0
        environment:
            DB_PASSWORD: $$cap_app_db_pass
            DB_USERNAME: $$cap_app_db_user
            DB_DATABASE_NAME: $$cap_app_db_name
            DB_HOSTNAME: srv-captain--$$cap_appname-db
            REDIS_HOSTNAME: srv-captain--$$cap_appname-redis
            UPLOAD_LOCATION: $$cap_app_upload_location
            IMMICH_MACHINE_LEARNING_URL: http://srv-captain--$$cap_appname-machine-learning:3003
        volumes:
            - $$cap_app_upload_location:/usr/src/app/upload
            - /etc/localtime:/etc/localtime:ro
        depends_on:
            - $$cap_appname-redis
            - $$cap_appname-db

    $$cap_appname-machine-learning:
        caproverExtra:
            notExposeAsWebApp: 'true'
        image: ghcr.io/immich-app/immich-machine-learning:$$cap_version
        environment:
            DB_PASSWORD: $$cap_app_db_pass
            DB_USERNAME: $$cap_app_db_user
            DB_DATABASE_NAME: $$cap_app_db_name
            DB_HOSTNAME: srv-captain--$$cap_appname-db
            REDIS_HOSTNAME: srv-captain--$$cap_appname-redis
            UPLOAD_LOCATION: $$cap_app_upload_location
        volumes:
            - $$cap_appname-model-cache:/cache

    $$cap_appname-redis:
        caproverExtra:
            notExposeAsWebApp: 'true'
        image: redis:$$cap_redis_ver

    $$cap_appname-db:
        caproverExtra:
            notExposeAsWebApp: 'true'
        image: tensorchord/pgvecto-rs:$$cap_app_db_ver
        environment:
            POSTGRES_PASSWORD: $$cap_app_db_pass
            POSTGRES_USER: $$cap_app_db_user
            POSTGRES_DB: $$cap_app_db_name
            PG_DATA: /var/lib/postgresql/data
        volumes:
            - $$cap_appname-db-data:/var/lib/postgresql/data

caproverOneClickApp:
    displayName: Immich
    description: Open source (MIT License) Google Photos alternative. Backup your phone's photos and videos to your private server.
    isOfficial: false
    documentation: https://immich.app
    instructions:
        start: |-
            Leave every default value as is for a working and simple installation. You can specify the (full) path to the directory you want to save your media, in that case the directory must exist beforehand. Immich can be accessed via browser and with an app (Immich). If you have big media files (bigger than 500MB) in your phone, update your Nginx configuration to increase your `client_max_body_size`.
        end: |-
            On your first visit it will ask for email and password for the admin user. Remember to change the default Nginx configuration and increasing the 'client_max_body_size' value if you expect to upload files bigger than 500MB.
    variables:
        - label: Immich version
          id: $$cap_version
          description: Check out their valid tags at https://github.com/immich-app/immich/releases
          defaultValue: v1.92.1
        - label: Immich redis version
          id: $$cap_redis_ver
          defaultValue: 6.2-alpine@sha256:c5a607fb6e1bb15d32bbcf14db22787d19e428d59e31a5da67511b49bb0f1ccc
          description: Check out their valid tags at https://hub.docker.com/_/redis/tags
        - label: Database password
          id: $$cap_app_db_pass
          description: Password for accessing the database. A random one has been generated for you.
          defaultValue: $$cap_gen_random_hex(32)
        - label: Database username
          id: $$cap_app_db_user
          description: Username to access the database
          defaultValue: 'immich'
        - label: Database name
          id: $$cap_app_db_name
          description: A name for the database used by Immich
          defaultValue: 'immich'
        - label: PostgreSQL database version
          id: $$cap_app_db_ver
          description: Immich uses PostgreSQL with the pgvecto.rs extension. Check the valid tags at https://hub.docker.com/r/tensorchord/pgvecto-rs/tags
          defaultValue: pg14-v0.1.11@sha256:0335a1a22f8c5dd1b697f14f079934f5152eaaa216c09b61e293be285491f8ee
        - label: Upload directory
          id: $$cap_app_upload_location
          description: Full path to the directory where you plan to store all your files. It should be created beforehand. If you want caprover to create it for you just leave the default 'immich-data'
          defaultValue: immich-data

@githubsaturn
Copy link
Collaborator

Just merged the PR! Thank you!

@nirjhar
Copy link

nirjhar commented Jan 17, 2024

Just merged the PR! Thank you!

Thanks a lot!

@nirjhar
Copy link

nirjhar commented Jan 25, 2024

I don't know. But if you're on a rush, you can always copy the text of the recipe, paste it in a Template and get going.

In your caprover instance click on 'One-Click Apps/Databases' button. Then search for the 'Template' one, and paste the result of my PR inside. Click 'next' and follow the instructions as if it were any other One-Click App.

captainVersion: 4

services:
    $$cap_appname:
        caproverExtra:
            dockerfileLines:
                - FROM ghcr.io/immich-app/immich-server:$$cap_version
                - CMD ["start.sh", "immich"]
            containerHttpPort: 3001
        environment:
            DB_PASSWORD: $$cap_app_db_pass
            DB_USERNAME: $$cap_app_db_user
            DB_DATABASE_NAME: $$cap_app_db_name
            DB_HOSTNAME: srv-captain--$$cap_appname-db
            REDIS_HOSTNAME: srv-captain--$$cap_appname-redis
            UPLOAD_LOCATION: $$cap_app_upload_location
            IMMICH_MACHINE_LEARNING_URL: http://srv-captain--$$cap_appname-machine-learning:3003
        volumes:
            - $$cap_app_upload_location:/usr/src/app/upload
            - /etc/localtime:/etc/localtime:ro
        depends_on:
            - $$cap_appname-redis
            - $$cap_appname-db

    $$cap_appname-microservices:
        caproverExtra:
            notExposeAsWebApp: 'true'
            dockerfileLines:
                - FROM ghcr.io/immich-app/immich-server:$$cap_version
                - CMD ["start.sh", "microservices"]
                # - ENTRYPOINT ["/bin/sh", "./start-microservices.sh"] Changed for v1.58.0
        environment:
            DB_PASSWORD: $$cap_app_db_pass
            DB_USERNAME: $$cap_app_db_user
            DB_DATABASE_NAME: $$cap_app_db_name
            DB_HOSTNAME: srv-captain--$$cap_appname-db
            REDIS_HOSTNAME: srv-captain--$$cap_appname-redis
            UPLOAD_LOCATION: $$cap_app_upload_location
            IMMICH_MACHINE_LEARNING_URL: http://srv-captain--$$cap_appname-machine-learning:3003
        volumes:
            - $$cap_app_upload_location:/usr/src/app/upload
            - /etc/localtime:/etc/localtime:ro
        depends_on:
            - $$cap_appname-redis
            - $$cap_appname-db

    $$cap_appname-machine-learning:
        caproverExtra:
            notExposeAsWebApp: 'true'
        image: ghcr.io/immich-app/immich-machine-learning:$$cap_version
        environment:
            DB_PASSWORD: $$cap_app_db_pass
            DB_USERNAME: $$cap_app_db_user
            DB_DATABASE_NAME: $$cap_app_db_name
            DB_HOSTNAME: srv-captain--$$cap_appname-db
            REDIS_HOSTNAME: srv-captain--$$cap_appname-redis
            UPLOAD_LOCATION: $$cap_app_upload_location
        volumes:
            - $$cap_appname-model-cache:/cache

    $$cap_appname-redis:
        caproverExtra:
            notExposeAsWebApp: 'true'
        image: redis:$$cap_redis_ver

    $$cap_appname-db:
        caproverExtra:
            notExposeAsWebApp: 'true'
        image: tensorchord/pgvecto-rs:$$cap_app_db_ver
        environment:
            POSTGRES_PASSWORD: $$cap_app_db_pass
            POSTGRES_USER: $$cap_app_db_user
            POSTGRES_DB: $$cap_app_db_name
            PG_DATA: /var/lib/postgresql/data
        volumes:
            - $$cap_appname-db-data:/var/lib/postgresql/data

caproverOneClickApp:
    displayName: Immich
    description: Open source (MIT License) Google Photos alternative. Backup your phone's photos and videos to your private server.
    isOfficial: false
    documentation: https://immich.app
    instructions:
        start: |-
            Leave every default value as is for a working and simple installation. You can specify the (full) path to the directory you want to save your media, in that case the directory must exist beforehand. Immich can be accessed via browser and with an app (Immich). If you have big media files (bigger than 500MB) in your phone, update your Nginx configuration to increase your `client_max_body_size`.
        end: |-
            On your first visit it will ask for email and password for the admin user. Remember to change the default Nginx configuration and increasing the 'client_max_body_size' value if you expect to upload files bigger than 500MB.
    variables:
        - label: Immich version
          id: $$cap_version
          description: Check out their valid tags at https://github.com/immich-app/immich/releases
          defaultValue: v1.92.1
        - label: Immich redis version
          id: $$cap_redis_ver
          defaultValue: 6.2-alpine@sha256:c5a607fb6e1bb15d32bbcf14db22787d19e428d59e31a5da67511b49bb0f1ccc
          description: Check out their valid tags at https://hub.docker.com/_/redis/tags
        - label: Database password
          id: $$cap_app_db_pass
          description: Password for accessing the database. A random one has been generated for you.
          defaultValue: $$cap_gen_random_hex(32)
        - label: Database username
          id: $$cap_app_db_user
          description: Username to access the database
          defaultValue: 'immich'
        - label: Database name
          id: $$cap_app_db_name
          description: A name for the database used by Immich
          defaultValue: 'immich'
        - label: PostgreSQL database version
          id: $$cap_app_db_ver
          description: Immich uses PostgreSQL with the pgvecto.rs extension. Check the valid tags at https://hub.docker.com/r/tensorchord/pgvecto-rs/tags
          defaultValue: pg14-v0.1.11@sha256:0335a1a22f8c5dd1b697f14f079934f5152eaaa216c09b61e293be285491f8ee
        - label: Upload directory
          id: $$cap_app_upload_location
          description: Full path to the directory where you plan to store all your files. It should be created beforehand. If you want caprover to create it for you just leave the default 'immich-data'
          defaultValue: immich-data

Need help to update to the latest version caprover. Docker Hub tag is not working. Breaking the app. Can you please show me the right way.

@borjarobert
Copy link
Contributor Author

The right way to update is to redeploy the three updated apps using Method 4 (Deploy plain Dockerfile) inside their Deployment tab.

For immich:

FROM ghcr.io/immich-app/immich-server:v1.93.3
CMD [ "start.sh", "immich" ]

for immich-microservices:

FROM ghcr.io/immich-app/immich-server:v1.93.3
CMD [ "start.sh", "microservices" ]

for immich-machine-learning:

FROM ghcr.io/immich-app/immich-machine-learning:v1.93.3

Just updating the image doesn't work because you have to run the CMD to start them properly

@rambles
Copy link

rambles commented Mar 24, 2024

Here's an updated install script for Immich v1.99. There was a breaking change in v1.95 which meant the default pgvectors release in the script from @borjarobert would no longer work. The Redis release is updated too, but I don't think that was a breaking change.

captainVersion: 4

services:
    $$cap_appname:
        caproverExtra:
            dockerfileLines:
                - FROM ghcr.io/immich-app/immich-server:$$cap_version
                - CMD ["start.sh", "immich"]
            containerHttpPort: 3001
        environment:
            DB_PASSWORD: $$cap_app_db_pass
            DB_USERNAME: $$cap_app_db_user
            DB_DATABASE_NAME: $$cap_app_db_name
            DB_HOSTNAME: srv-captain--$$cap_appname-db
            REDIS_HOSTNAME: srv-captain--$$cap_appname-redis
            UPLOAD_LOCATION: $$cap_app_upload_location
            IMMICH_MACHINE_LEARNING_URL: http://srv-captain--$$cap_appname-machine-learning:3003
        volumes:
            - $$cap_app_upload_location:/usr/src/app/upload
            - /etc/localtime:/etc/localtime:ro
        depends_on:
            - $$cap_appname-redis
            - $$cap_appname-db

    $$cap_appname-microservices:
        caproverExtra:
            notExposeAsWebApp: 'true'
            dockerfileLines:
                - FROM ghcr.io/immich-app/immich-server:$$cap_version
                - CMD ["start.sh", "microservices"]
                # - ENTRYPOINT ["/bin/sh", "./start-microservices.sh"] Changed for v1.58.0
        environment:
            DB_PASSWORD: $$cap_app_db_pass
            DB_USERNAME: $$cap_app_db_user
            DB_DATABASE_NAME: $$cap_app_db_name
            DB_HOSTNAME: srv-captain--$$cap_appname-db
            REDIS_HOSTNAME: srv-captain--$$cap_appname-redis
            UPLOAD_LOCATION: $$cap_app_upload_location
            IMMICH_MACHINE_LEARNING_URL: http://srv-captain--$$cap_appname-machine-learning:3003
        volumes:
            - $$cap_app_upload_location:/usr/src/app/upload
            - /etc/localtime:/etc/localtime:ro
        depends_on:
            - $$cap_appname-redis
            - $$cap_appname-db

    $$cap_appname-machine-learning:
        caproverExtra:
            notExposeAsWebApp: 'true'
        image: ghcr.io/immich-app/immich-machine-learning:$$cap_version
        environment:
            DB_PASSWORD: $$cap_app_db_pass
            DB_USERNAME: $$cap_app_db_user
            DB_DATABASE_NAME: $$cap_app_db_name
            DB_HOSTNAME: srv-captain--$$cap_appname-db
            REDIS_HOSTNAME: srv-captain--$$cap_appname-redis
            UPLOAD_LOCATION: $$cap_app_upload_location
        volumes:
            - $$cap_appname-model-cache:/cache

    $$cap_appname-redis:
        caproverExtra:
            notExposeAsWebApp: 'true'
        image: redis:$$cap_redis_ver

    $$cap_appname-db:
        caproverExtra:
            notExposeAsWebApp: 'true'
        image: tensorchord/pgvecto-rs:$$cap_app_db_ver
        environment:
            POSTGRES_PASSWORD: $$cap_app_db_pass
            POSTGRES_USER: $$cap_app_db_user
            POSTGRES_DB: $$cap_app_db_name
            PG_DATA: /var/lib/postgresql/data
        volumes:
            - $$cap_appname-db-data:/var/lib/postgresql/data

caproverOneClickApp:
    displayName: Immich
    description: Open source (MIT License) Google Photos alternative. Backup your phone's photos and videos to your private server.
    isOfficial: false
    documentation: https://immich.app
    instructions:
        start: |-
            Leave every default value as is for a working and simple installation. You can specify the (full) path to the directory you want to save your media, in that case the directory must exist beforehand. Immich can be accessed via browser and with an app (Immich). If you have big media files (bigger than 500MB) in your phone, update your Nginx configuration to increase your `client_max_body_size`.
        end: |-
            On your first visit it will ask for email and password for the admin user. Remember to change the default Nginx configuration and increasing the 'client_max_body_size' value if you expect to upload files bigger than 500MB.
    variables:
        - label: Immich version
          id: $$cap_version
          description: Check out their valid tags at https://github.com/immich-app/immich/releases
          defaultValue: v1.99.0
        - label: Immich redis version
          id: $$cap_redis_ver
          defaultValue: 6.2-alpine@sha256:51d6c56749a4243096327e3fb964a48ed92254357108449cb6e23999c37773c5
          description: Check out their valid tags at https://hub.docker.com/_/redis/tags
        - label: Database password
          id: $$cap_app_db_pass
          description: Password for accessing the database. A random one has been generated for you.
          defaultValue: $$cap_gen_random_hex(32)
        - label: Database username
          id: $$cap_app_db_user
          description: Username to access the database
          defaultValue: 'immich'
        - label: Database name
          id: $$cap_app_db_name
          description: A name for the database used by Immich
          defaultValue: 'immich'
        - label: PostgreSQL database version
          id: $$cap_app_db_ver
          description: Immich uses PostgreSQL with the pgvecto.rs extension. Check the valid tags at https://hub.docker.com/r/tensorchord/pgvecto-rs/tags
          defaultValue: pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
        - label: Upload directory
          id: $$cap_app_upload_location
          description: Full path to the directory where you plan to store all your files. It should be created beforehand. If you want caprover to create it for you just leave the default 'immich-data'
          defaultValue: immich-data

@borjarobert
Copy link
Contributor Author

borjarobert commented Mar 24, 2024

It was without the change in the redis image, but I submitted a PR #1089 with an equivalent update, plus reflecting the license change and the new logo. Hope it gets added soon. Thanks!

@arthuragone
Copy link

Here's an updated install script for Immich v1.99. There was a breaking change in v1.95 which meant the default pgvectors release in the script from @borjarobert would no longer work. The Redis release is updated too, but I don't think that was a breaking change.

captainVersion: 4

services:
    $$cap_appname:
        caproverExtra:
            dockerfileLines:
                - FROM ghcr.io/immich-app/immich-server:$$cap_version
                - CMD ["start.sh", "immich"]
            containerHttpPort: 3001
        environment:
            DB_PASSWORD: $$cap_app_db_pass
            DB_USERNAME: $$cap_app_db_user
            DB_DATABASE_NAME: $$cap_app_db_name
            DB_HOSTNAME: srv-captain--$$cap_appname-db
            REDIS_HOSTNAME: srv-captain--$$cap_appname-redis
            UPLOAD_LOCATION: $$cap_app_upload_location
            IMMICH_MACHINE_LEARNING_URL: http://srv-captain--$$cap_appname-machine-learning:3003
        volumes:
            - $$cap_app_upload_location:/usr/src/app/upload
            - /etc/localtime:/etc/localtime:ro
            - /srv/photos/young-tom:/mnt/media/young-tom:ro
        depends_on:
            - $$cap_appname-redis
            - $$cap_appname-db

    $$cap_appname-microservices:
        caproverExtra:
            notExposeAsWebApp: 'true'
            dockerfileLines:
                - FROM ghcr.io/immich-app/immich-server:$$cap_version
                - CMD ["start.sh", "microservices"]
                # - ENTRYPOINT ["/bin/sh", "./start-microservices.sh"] Changed for v1.58.0
        environment:
            DB_PASSWORD: $$cap_app_db_pass
            DB_USERNAME: $$cap_app_db_user
            DB_DATABASE_NAME: $$cap_app_db_name
            DB_HOSTNAME: srv-captain--$$cap_appname-db
            REDIS_HOSTNAME: srv-captain--$$cap_appname-redis
            UPLOAD_LOCATION: $$cap_app_upload_location
            IMMICH_MACHINE_LEARNING_URL: http://srv-captain--$$cap_appname-machine-learning:3003
        volumes:
            - $$cap_app_upload_location:/usr/src/app/upload
            - /etc/localtime:/etc/localtime:ro
            - /srv/photos/young-tom:/mnt/media/young-tom:ro
        depends_on:
            - $$cap_appname-redis
            - $$cap_appname-db

    $$cap_appname-machine-learning:
        caproverExtra:
            notExposeAsWebApp: 'true'
        image: ghcr.io/immich-app/immich-machine-learning:$$cap_version
        environment:
            DB_PASSWORD: $$cap_app_db_pass
            DB_USERNAME: $$cap_app_db_user
            DB_DATABASE_NAME: $$cap_app_db_name
            DB_HOSTNAME: srv-captain--$$cap_appname-db
            REDIS_HOSTNAME: srv-captain--$$cap_appname-redis
            UPLOAD_LOCATION: $$cap_app_upload_location
        volumes:
            - $$cap_appname-model-cache:/cache

    $$cap_appname-redis:
        caproverExtra:
            notExposeAsWebApp: 'true'
        image: redis:$$cap_redis_ver

    $$cap_appname-db:
        caproverExtra:
            notExposeAsWebApp: 'true'
        image: tensorchord/pgvecto-rs:$$cap_app_db_ver
        environment:
            POSTGRES_PASSWORD: $$cap_app_db_pass
            POSTGRES_USER: $$cap_app_db_user
            POSTGRES_DB: $$cap_app_db_name
            PG_DATA: /var/lib/postgresql/data
        volumes:
            - $$cap_appname-db-data:/var/lib/postgresql/data

caproverOneClickApp:
    displayName: Immich
    description: Open source (MIT License) Google Photos alternative. Backup your phone's photos and videos to your private server.
    isOfficial: false
    documentation: https://immich.app
    instructions:
        start: |-
            Leave every default value as is for a working and simple installation. You can specify the (full) path to the directory you want to save your media, in that case the directory must exist beforehand. Immich can be accessed via browser and with an app (Immich). If you have big media files (bigger than 500MB) in your phone, update your Nginx configuration to increase your `client_max_body_size`.
        end: |-
            On your first visit it will ask for email and password for the admin user. Remember to change the default Nginx configuration and increasing the 'client_max_body_size' value if you expect to upload files bigger than 500MB.
    variables:
        - label: Immich version
          id: $$cap_version
          description: Check out their valid tags at https://github.com/immich-app/immich/releases
          defaultValue: v1.99.0
        - label: Immich redis version
          id: $$cap_redis_ver
          defaultValue: 6.2-alpine@sha256:51d6c56749a4243096327e3fb964a48ed92254357108449cb6e23999c37773c5
          description: Check out their valid tags at https://hub.docker.com/_/redis/tags
        - label: Database password
          id: $$cap_app_db_pass
          description: Password for accessing the database. A random one has been generated for you.
          defaultValue: $$cap_gen_random_hex(32)
        - label: Database username
          id: $$cap_app_db_user
          description: Username to access the database
          defaultValue: 'immich'
        - label: Database name
          id: $$cap_app_db_name
          description: A name for the database used by Immich
          defaultValue: 'immich'
        - label: PostgreSQL database version
          id: $$cap_app_db_ver
          description: Immich uses PostgreSQL with the pgvecto.rs extension. Check the valid tags at https://hub.docker.com/r/tensorchord/pgvecto-rs/tags
          defaultValue: pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
        - label: Upload directory
          id: $$cap_app_upload_location
          description: Full path to the directory where you plan to store all your files. It should be created beforehand. If you want caprover to create it for you just leave the default 'immich-data'
          defaultValue: immich-data

Thank you for this new script. But I still got a nginx issue. I think there is some settings to modify but can't get what to change.

@nirjhar
Copy link

nirjhar commented Jun 2, 2024

Can you guys make an oneclick script for PHP IPAM?

@nirjhar
Copy link

nirjhar commented Jun 20, 2024

After upgrading to 106.2 (where they removed the microservice container) thumbnail generation and all other jobs is not working. What to do?

@nirjhar
Copy link

nirjhar commented Jun 21, 2024

The right way to update is to redeploy the three updated apps using Method 4 (Deploy plain Dockerfile) inside their Deployment tab.

For immich:

FROM ghcr.io/immich-app/immich-server:v1.93.3
CMD [ "start.sh", "immich" ]

for immich-microservices:

FROM ghcr.io/immich-app/immich-server:v1.93.3
CMD [ "start.sh", "microservices" ]

for immich-machine-learning:

FROM ghcr.io/immich-app/immich-machine-learning:v1.93.3

Just updating the image doesn't work because you have to run the CMD to start them properly

Please update it for the new build. As they dropped micro services, background job is not updating. Please help.

@rambles
Copy link

rambles commented Sep 13, 2024

Did anyone ever manage to address this? Updating Immich in Caprover is now really difficult. And transferring a pg_dump of the data from an old Immich installtion to a new one isn't too easy, either!

@nirjhar
Copy link

nirjhar commented Sep 14, 2024

What method are you using for the update?

@nirjhar
Copy link

nirjhar commented Sep 14, 2024

Did anyone ever manage to address this? Updating Immich in Caprover is now really difficult. And transferring a pg_dump of the data from an old Immich installtion to a new one isn't too easy, either!

What method are you using?

@borjarobert
Copy link
Contributor Author

I've had the same Immich instance (through caprover) for quite some time and, while I haven't found a way to make it easily updateable, I still manage to update it when needed.

I'll be updating the recipe soon because it can now be slightly simplified by changing a deploy method from a DockerfileLines FROM to an image, but it's essentially the same as explained before in this thread.

You just need to redeploy the immich container with ghcr.io/immich-app/immich-server:v1.115.0 through method 6 in the Deployment tab and immich-machine-learning with ghcr.io/immich-app/immich-machine-learning:v1.115.0 through the same method.

The database and redis version haven't changed in a while as far as I'm aware, so no need to redeploy them.

@arthuragone
Copy link

I managed to update both Immich container and immich machine learning container, but since version 1.106.1 they suppresed the microservice container as not needed anymore. But as I've installed the app before this version and making updates since, it's still here and I think some background jobs do not work now as this container should not be used anymore.

I think there is not much to do, but can't figure out what

@nirjhar
Copy link

nirjhar commented Sep 16, 2024

Here is the detail steop to resolve this issue:
Note: You don't need the Microservices container. You can delete that pod.

Use the method for to upgrade/update immich-server and immich-machine-learning. For example if you want to upgrade to V1.115.0 just use:
FROM ghcr.io/immich-app/immich-server:v1.115.0 (for immich server in method 4 and just hit the deploy button. wait for a few minutes to deploy.. depending on your host speed/connection).
FROM ghcr.io/immich-app/immich-machine-learning:v1.115.0 (for immich-machine-learning. Samme as immich server method.

Feel free to knock me if you have any trouble.
Thanks and greetings from Dhaka, Bangladehs.

@rambles
Copy link

rambles commented Sep 16, 2024

The updates suggested by @borjarobert and @nirjhar are perfect in general. But I've left things somewhat late, upgrading from version ... 0.98, I think? ... in some of the interim releases brought breaking changes!

Applying the update anyway (using @borjarobert's suggestion) resulted in the server not starting, asking for (I assume) new upload folders (/upload/profile/.immich I think and /upload/encode_videos/.immich - something like that). I added these as env vars in Caprover, but nothing really came of it.

Thinking I might be better off with. anew Immich install, I've tried exporting my database, both to import into the new Immich instance via pgdump, or in its own folder, outside of Docker, as introduced in v1.102 (immich-app/immich#8930). I tried multiple approaches to the latter, always resulting in the following message:-

"root" execution of the PostgreSQL server is not permitted. The server must be started under an unprivileged user ID to prevent. possible system security compromise. See the documentation for. more information on how to properly start the server.

I did write a new template script from Immice v1.115 which incorporates the external Postgres library. It isn't quite working for me yielding the 'root execution err above, but it might work for others, or need only a little tweak:-

captainVersion: 4

services:
    $$cap_appname:
        caproverExtra:
            dockerfileLines:
                - FROM ghcr.io/immich-app/immich-server:$$cap_version
                - CMD ["start.sh", "immich"]
            containerHttpPort: 3001
        environment:
            UPLOAD_LOCATION: $$cap_app_upload_location
            DB_DATA_LOCATION: $$cap_appname-db-data
            TZ: "Europe/Berlin"
            DB_PASSWORD: $$cap_app_db_pass
            DB_USERNAME: $$cap_app_db_user
            DB_DATABASE_NAME: $$cap_app_db_name
        volumes:
            - $$cap_app_upload_location:/usr/src/app/upload
            - /etc/localtime:/etc/localtime:ro
        depends_on:
            - $$cap_appname-redis
            - $$cap_appname-db

    $$cap_appname-machine-learning:
        caproverExtra:
            notExposeAsWebApp: 'true'
        image: ghcr.io/immich-app/immich-machine-learning:$$cap_version
        environment:
            UPLOAD_LOCATION: $$cap_app_upload_location
            DB_DATA_LOCATION: $$cap_appname-db-data
            TZ: "Europe/Berlin"
            DB_PASSWORD: $$cap_app_db_pass
            DB_USERNAME: $$cap_app_db_user
            DB_DATABASE_NAME: $$cap_app_db_name
        volumes:
            - $$cap_appname-model-cache:/cache

    $$cap_appname-redis:
        caproverExtra:
            notExposeAsWebApp: 'true'
        image: redis:$$cap_redis_ver
        healthcheck:
          test: redis-cli ping || exit 1

    $$cap_appname-db:
        caproverExtra:
            notExposeAsWebApp: 'true'
        image: docker.io/tensorchord/pgvecto-rs:$$cap_app_db_ver
        environment:
            POSTGRES_PASSWORD: $$cap_app_db_pass
            POSTGRES_USER: $$cap_app_db_user
            POSTGRES_DB: $$cap_app_db_name
            POSTGRES_INITDB_ARGS: '--data-checksums'
        volumes:
            # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
            - $$cap_appname-db-data:/var/lib/postgresql/data
        healthcheck:
            test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
            interval: 5m
            start_interval: 30s
            start_period: 5m
        command: ["postgres", "-c", "shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"]

volumes:
  model-cache:

caproverOneClickApp:
    displayName: Immich
    description: Open source (MIT License) Google Photos alternative. Backup your phone's photos and videos to your private server.
    isOfficial: false
    documentation: https://immich.app
    instructions:
        start: |-
            Leave every default value as is for a working and simple installation. You can specify the (full) path to the directory you want to save your media, in that case the directory must exist beforehand. Immich can be accessed via browser and with an app (Immich). If you have big media files (bigger than 500MB) in your phone, update your Nginx configuration to increase your `client_max_body_size`.
        end: |-
            On your first visit it will ask for email and password for the admin user. Remember to change the default Nginx configuration and increasing the 'client_max_body_size' value if you expect to upload files bigger than 500MB.
    variables:
        - label: Immich version
          id: $$cap_version
          description: Check out their valid tags at https://github.com/immich-app/immich/releases
          defaultValue: v1.115.0
        - label: Immich redis version
          id: $$cap_redis_ver 
          defaultValue: 6.2-alpine@sha256:2d1463258f2764328496376f5d965f20c6a67f66ea2b06dc42af351f75248792
          description: Check out their valid tags at https://hub.docker.com/_/redis/tags
        - label: Database password
          id: $$cap_app_db_pass
          description: Password for accessing the database. A random one has been generated for you.
          defaultValue: new_pwd!!123
        - label: Database username
          id: $$cap_app_db_user
          description: Username to access the database
          defaultValue: 'postgres'
        - label: Database name
          id: $$cap_app_db_name
          description: A name for the database used by Immich
          defaultValue: 'immich'
        - label: PostgreSQL database version
          id: $$cap_app_db_ver
          description: Immich uses PostgreSQL with the pgvecto.rs extension. Check the valid tags at https://hub.docker.com/r/tensorchord/pgvecto-rs/tags
          defaultValue: pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
        - label: Upload directory
          id: $$cap_app_upload_location
          description: Full path to the directory where you plan to store all your files. It should be created beforehand. If you want caprover to create it for you just leave the default 'immich-data'
          defaultValue: /srv/photos/upl_folder/
        - label: Local postgres folder
          id: $$cap_appname-db-data
          description: Full path to the directory where the locally saved postgres data is. This ensures the data is not locked away within Docker.
          defaultValue: /srv/photos/` 

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

Successfully merging this pull request may close these issues.

5 participants