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

[Feature] Unraid Community / All-Inclusive Image #84

Closed
3 tasks
alextran1502 opened this issue Mar 29, 2022 · 90 comments
Closed
3 tasks

[Feature] Unraid Community / All-Inclusive Image #84

alextran1502 opened this issue Mar 29, 2022 · 90 comments

Comments

@alextran1502
Copy link
Contributor

alextran1502 commented Mar 29, 2022

Feature Details:

  • Create a single docker image for all components
  • Create necessary XML files for publishing the new image to the unraid community applications section.
  • We will create the necessary thread on the unraid forum after any PRs are merged.

Follow the guide here for steps to create the required XML files for unraid.

@JamesTeague
Copy link

Is there an existing Docker image on Docker Hub already or would one need to get it into a registry?

@JamesTeague
Copy link

Also there seems to be a dependency on Postgres running in port 5432. Did I read that right? If so, that port should probably be configurable defaulting to 5432.

@alextran1502
Copy link
Contributor Author

@JamesTeague There is no image that contains the whole application yet. I am working on the branch deployment/containerize-app-into-single-dockerfile to accomplish that goal.

It is correct that the Postgres port is 5432. You can access it on your local machine as well as throughout your local network with the VM IPV4

@JamesTeague
Copy link

@alextran1502 Regarding the port that is true, but there will be people running Postgres in a container not using port 5432. It's generally not a good assumption that the database will be exposed on that port. So in the case of Unraid it would help users to know that this template requires their own postées instance but it shouldn't also dictate the port they have to expose on the container. Or if for some reason they are running multiple instances of the database, 1 has to be running on a different port.

Once the container is in the registry though I wouldn't mind helping get the template set up and tested. Or trying to contribute on other things as well.

@Kjeldgaard
Copy link

Kjeldgaard commented May 21, 2022

@JamesTeague There is no image that contains the whole application yet. I am working on the branch deployment/containerize-app-into-single-dockerfile to accomplish that goal.

Isn't the immich image sufficient if using an existing database?

@alextran1502
Copy link
Contributor Author

@JamesTeague There is no image that contains the whole application yet. I am working on the branch deployment/containerize-app-into-single-dockerfile to accomplish that goal.

Isn't the immich image sufficient if using an existing database?

There is a message queue that utilizes Redis for passing the message across the background processes, so you would need Redis as well.

Now that I am adding a web interface that is using SvelteKit, which has its own built-in Nodejs server, this adds an additional complexity to the process of putting everything into a single Docker image.

@Kjeldgaard
Copy link

I actually already have Redis up and running, but how should that be configured? According to 'Step 1' from https://github.com/alextran1502/immich, there is only the database configuration.

@JamesTeague
Copy link

@JamesTeague There is no image that contains the whole application yet. I am working on the branch deployment/containerize-app-into-single-dockerfile to accomplish that goal.

Isn't the immich image sufficient if using an existing database?

I think so, most people probably want to decouple that and Redis anyway.

@zackpollard zackpollard changed the title Unraid Community Image [Feature] Unraid Community Image Jun 24, 2022
@zackpollard zackpollard added this to the First Release milestone Jun 24, 2022
@martabal
Copy link
Member

@JamesTeague There is no image that contains the whole application yet. I am working on the branch deployment/containerize-app-into-single-dockerfile to accomplish that goal.

The branch doesn't exist anymore. It would be very nice to have a single container to deploy. I already have postgres and redis dockers running and don't want to deploy other instances.

@zackpollard
Copy link
Contributor

You can use environment variables to point your Immich services at your existing redis and postgres containers, check the .env file

@martabal
Copy link
Member

Is it possible to get rid of the .env file and to use only the environment variables ? It would allow to run the services with docker run

@bo0tzz
Copy link
Member

bo0tzz commented Aug 1, 2022

Sure, you can skip the .env file and pass the variables in any other way you like.

@martabal
Copy link
Member

martabal commented Aug 7, 2022

For now Immich works with Unraid with the docker-compose plugin but in my understanding to run with the docker run command, it would be easier to integrate the entrypoint in the Dockerfile. Is there any particular reason to put it outside the file?

@Nonobis
Copy link

Nonobis commented Aug 8, 2022

yes the custom entrypoint is the main problem .. in my case, even in advanced docker mode in unraid i don't see where to put the custom entrypoint for each image.

@martabal
Copy link
Member

martabal commented Aug 8, 2022

There is the --entrypoint argument but it is for overwriting the default entrypoint of the image. But there is no entrypoint by default in the images. So it is currently impossible to run Immich images with docker run

@bo0tzz
Copy link
Member

bo0tzz commented Aug 8, 2022

The images are built on top of the node base image, so there is a default entrypoint defined that you can override. A command like docker run --entrypoint /bin/sh altran1502/immich-server:release ./start-server.sh works just fine (it doesn't have the necessary config, but it will start the right executable). That said, I agree that having entrypoints defined in the images is nicer, and I've suggested it to the team.

@martabal
Copy link
Member

martabal commented Aug 8, 2022

For a release on Unraid, it would be a lot better to avoid arguments other than path, device, port or environment variable. Other arguments has to be passed with the extra-parameters field which is not very user-friendly.
And of course to have only one image.

@guim31
Copy link

guim31 commented Aug 9, 2022

Sorry for my useless message but I have to say I would really love ab easy unraid install !!!

@martabal
Copy link
Member

martabal commented Aug 14, 2022

I managed to install altran1502/immich-server:release on Unraid without docker-compose. But for now there is too many images to publish it for Unraid community. Another thing I noticed with my install is that I created a specific user on Postgres to Immich but it didn't work, I had to pass the default postgres user to work.

@guim31
Copy link

guim31 commented Aug 16, 2022

Thanks @martabal for your feedback.
I hope someone with some Docker skills could merge all those images in one !

@martabal
Copy link
Member

No problem, I will try to merge the images next week

@blaine07
Copy link

No problem, I will try to merge the images next week

You’d be a hero here. Looking forward to this! :-)

@dsfsdbvxc
Copy link

No problem, I will try to merge the images next week

Yea thanks, keen to give this a go :)

@dhruvinsh
Copy link

dhruvinsh commented Sep 2, 2022

I managed to install altran1502/immich-server:release on Unraid without docker-compose

@martabal how did manage to override the entrypoint? unraid webpage Extra Parameters doesn't seems to help
Edit:
Nevermind I got it working, I needed to use "Post Argument" commnad

@ark-
Copy link

ark- commented Sep 3, 2022

Would we need to install a bunch of individual "apps" (containers) one by one to get this working on unraid without docker-compose? It looks like there's 7 containers, is that right?

I'm hesitant to use compose on unraid as it doesn't play well with their Web UI and that is my primary interface to the server.

@blaine07
Copy link

Google says my Dell T610 doesn't have AVX support; so thats probably the reason my machine learning portion won't stay running: #300

Still not sure of the side effects of it not running or if that will cause me other issues. Also still unsure if docker compose plugin installed on Unraid if it is normal for it to say this at bottom of the docker tab:

Invalid argument supplied for foreach() in /usr/local/emhttp/plugins/compose.manager/php/compose_manager_main.php on line 32

@martabal
Copy link
Member

Wouldn't it be better to use environment variables rather than using hardcoded urls ? This would allow for a single image and users to rename their containers as they wish. #647

const res = await axios.post('http://immich-machine-learning:3003/image-classifier/tag-image', {

const res = await axios.post('http://immich-machine-learning:3003/object-detection/detect-object', {

serverApi.setBaseUrl('http://immich-server:3001');

proxy_pass http://immich-server:3001;

proxy_pass http://immich-web:3000;

@blaine07
Copy link

Every single time in Unraid I "docker compose down" then "Update Stack" MORE of my Docker Image is full. How can I "clean up" after this configuration? @Mattyfaz ? Anyone?

@bo0tzz
Copy link
Member

bo0tzz commented Oct 27, 2022

@blaine07
Copy link

https://docs.docker.com/engine/reference/commandline/system_prune/ should do the trick.

That will work in Unraid?

@blaine07
Copy link

blaine07 commented Oct 27, 2022

https://docs.docker.com/engine/reference/commandline/system_prune/ should do the trick.

I ran it; eventually the unraid command window wen't away. Didn't see that it did anything; docker image still larger than expected?

Did it from ssh and it deleted 284mb :scratches head:

Yep, that was a bad idea; deleted containers I had that weren't running...a few I can't seem to get recreated right. DOH LOL

@MattFaz
Copy link
Contributor

MattFaz commented Oct 27, 2022

Every single time in Unraid I "docker compose down" then "Update Stack" MORE of my Docker Image is full. How can I "clean up" after this configuration? @Mattyfaz ? Anyone?

Not sure sorry, I don’t think I have the same issue. I don’t click “docker compose down”, I just click “update stack” and it does it all for you.

@sohail579
Copy link

sohail579 commented Oct 27, 2022

Every single time in Unraid I "docker compose down" then "Update Stack" MORE of my Docker Image is full. How can I "clean up" after this configuration? @Mattyfaz ? Anyone?

Install user scripts and create this as a script it will remove any dangling images

#!/bin/bash

remove_orphaned_images="yes" # select "yes" or "no" to remove any orphaned images
remove_unconnected_volumes="yes" # select "yes" or "no" to remove any unconnected volumes

#Do not make changes below this line#

echo "##################################################################################"
echo "Cleanup before starting (if requested in script)"
echo "##################################################################################"
echo
if [ "$remove_orphaned_images" == "yes" ] ; then
echo "Removing orphaned images..."
echo
docker image prune -af
else
echo "Not removing orphaned images (this can be set in script if you want to)"
fi
echo
echo "---------------------------------------------------------------------------------"
echo
if [ "$remove_unconnected_volumes" == "yes" ] ; then
echo "Removing unconnected docker volumes"
echo
docker volume prune -f
else
echo "Not removing unconnected docker volumes (this can be set in script if you want to)"
fi
echo
echo "##################################################################################"
echo "List of Image, Container and docker volume size."
echo "##################################################################################"
echo
#docker system df
docker system df --format 'There are \t {{.TotalCount}} \t {{.Type}} \t taking up ......{{.Size}}'
echo
echo "##################################################################################"
echo "List of containers showing size and virtual size"
echo "##################################################################################"
echo
echo "First size is the writable layers of the container (Virtual size is writable and read only layers)"
echo
docker container ls -a --format '{{.Size}} \t Is being taken up by ......... {{.Image}}'
echo
echo "##################################################################################"
echo "List of containers in size order"
echo "##################################################################################"
echo
docker image ls --format "{{.Repository}} {{.Size}}" |
awk '{if ($2~/GB/) print substr($2, 1, length($2)-2) *1000 "MB - " $1 ; else print $2 " - " $1 }' |
sed '/^0/d' |
sort -nr
echo
echo "##################################################################################"
echo "List of docker volumes, the container which they are connected to their size"
echo "##################################################################################"
echo
volumes=$(docker volume ls --format '{{.Name}}')
for volume in $volumes
do
name=(docker ps -a --filter volume="$volume" --format '{{.Names}}' | sed 's/^/ /')
size=(du -sh $(docker volume inspect --format '{{ .Mountpoint }}' $volume) | cut -f -1)
echo "ID" "$volume"
echo "This volume connected to" $name "has a size of" $size
echo ""
done
echo
echo "##################################################################################"
echo
echo "Done. Scroll up to view results"
exit

@Enlinks
Copy link

Enlinks commented Nov 19, 2022

Not sure if this has been discussed but there are other templates (at least 1 I know of) like TubeArchivist that require multiple dockers to work correctly that currently work with the Unraid Community Applications Plugin. Would this approach be more appropriate?

@alextran1502 alextran1502 removed this from the First Release milestone Nov 22, 2022
@bo0tzz
Copy link
Member

bo0tzz commented Nov 25, 2022

It looks like TubeArchivist doesn't do anything special, they just have a template for each of their containers. At that point, docker-compose is still the better option :)

@alexbelgium
Copy link

I second the request, a single container for all elements would be great! I am managing Home Assistant addons, which is not compatible with stacks of several containers.

@bo0tzz
Copy link
Member

bo0tzz commented Jan 11, 2023

There is now a single AIO image at https://github.com/martabal/docker-immich. It isn't supported by the Immich team though.

@bo0tzz bo0tzz closed this as completed Jan 11, 2023
@github-project-automation github-project-automation bot moved this to Done in Immich Jan 11, 2023
@SmoochSmackers
Copy link

Sorry if this is a silly question, but since you closed this issue, does this mean that there will never be an official AIO Immich image? Only the third party one you linked to?

My number one issue right now, as an extremely novice self-hoster, is the way that I have to use docker compose on my Unraid machine to use it. The three issues I have with this is that:
1.) It spins up 5 separate containers.
2.) I cannot mass update it along with the rest of my docker containers and have to keep an eye on the github page for any new releases.
3.) I think that not having a single image available in Unraid's Community App store creates an artificial hurtle that limits Immich's reach. It took quite a lot of time, and build up of frustration with other photo hosting apps, to finally push me to learn how to use docker compose. I feel there are many like me out there, but with less time on their hands, who are not ready to take the plunge. It's a matter of getting more users/supporters by lowering the bar to entry.

To be clear, I'm not writing this in anger or frustration. To the contrary! I absolutely love this software and understand the ungodly amount of work you all must have in front of you, tackling such a project! I just wanted to give my perspective as a newbie trying their darndest to rip as many of Google's tendrils from my life as possible and taking back control of my data.

Thank you all for your amazing work, I've been looking for a solid google photos replacement for years now. From my experience trying to self-host Photoview, Photoprism, etc., Immich is far and away the best one I've come across, the only one that truly has a google photos-like experience with the mobile app, and the only one that has runs rock solid with almost no issues with its core functionalites. In fact, I love this project so much that I created a github account to better follow your progress and so that I could donate.

@alextran1502
Copy link
Contributor Author

alextran1502 commented Jan 11, 2023

@SmoochSmackers Thank you for your very detailed thoughts and ideas. On behalf of the team, I will answer your questions.

  1. When I first started building Immich, I structure the app to be microservices and make them scalable. In order to scale with Docker, you either need Docker Swarm or a simpler and straightforward approach is to use Docker Compose. The number of containers is the number of underlying technology you need for the solution to work. If you are a Windows user, and you install software that required a database, it will install the database as well, but the services are often hidden from your eyes so you don't notice them. With self-hosting, you install every yourself and you know exactly what technologies are required to run, so it might take some time to get used to. Lastly, the point of us not building the all-in-one solution is the level of maintenance and complexity involved that we don't have the resources to spare. We rather use it to develop and maintain the core functionality of the application.
  2. Immich is still under active development, so I encourage you not to rely on an auto-updating tool but to update the Docker's containers manually after reading the Release notes in cases there are breaking changes that need user involvement to perform a successful update
  3. As you can see that the motion of self-hosting solutions is moving toward Docker and containers more and more. And it is a learning experience for us all, you start off with the convenience of running your services from a click of a button, then eventually your needs grow and you want to be able to control, configure, and understand how the underlying technology that you run the services you are most depended on work. So there is no harm in trying to learn and to know more about those information/technologies. I would encourage all self-hosters to do that for the sake of securing their data/resources. We provide information to run and set up Immich on Unraid so it takes some learning but I think it will be worthwhile for all parties involved.

Cheer!

@jrasm91
Copy link
Contributor

jrasm91 commented Jan 11, 2023

Updated the immich docs to link to the community all-in-one github repository (#1301).

https://immich.app/docs/install/all-in-one

@SmoochSmackers
Copy link

@alextran1502 Thank you very much for your detailed reply! In regards to the Windows comparison, I'd honestly never thought of it in terms of everything an exe is doing in the background, so it makes a lot of sense that multiple containers would be a necessity. Regardless of how you need to do it, I'm just glad you're doing it!

Just spit-balling, but maybe, way down the line when you're not in active pre-production development, you could maybe revisit this, or even somehow put all the different containers on the unraid app store, such that one is a "core" for basic photo backup, another serves as an addon for utilizing the mobile app, another serves as an addon for machine learning, etc. No idea how possible any of that is, but I just wanted to throw it out there for consideration much later down the line.

Keep up the incredible work!! Thanks again!

@martabal
Copy link
Member

Hello !
Do you want that I maintain the all-in-one Dockerfile on a separate repo or do you want me to create a pull request ?

@jrasm91
Copy link
Contributor

jrasm91 commented Jan 11, 2023

I think we're good with you keeping it in a separate repo for now. We just get the occasional question about it, so now everyone will know to go ask you instead. 😁

@guim31
Copy link

guim31 commented Jan 12, 2023

@martabal do you think you could provide an unraid template ? I don't really know how your image could land on Unraid's community software... maybe it should be requested idk.
I know that everything could be working right know as it is, but like many other Unraid user, I use this system because of the simplicity to install Docker containers with just few clicks.

Thanks a lot for your work, and THANKS a lot @alextran1502

@jagjordi
Copy link
Contributor

Would it be possible to migrate from the normal docker-compose setup to the all-in-one docker preserving the database and uploaded pictures?

@jrasm91
Copy link
Contributor

jrasm91 commented Jan 12, 2023

Would it be possible to migrate from the normal docker-compose setup to the all-in-one docker preserving the database and uploaded pictures?

Immich persists data to the upload folder and postgres data volumes. As long as you start up the AIO with those same two volumes it should be possible.

@martabal
Copy link
Member

@guim31 Yep, I plan to do it this week. But you can already install it on unraid manually.

@martabal
Copy link
Member

@jrasm91 Is it ok that my image is published on unraid community apps ?

@jrasm91
Copy link
Contributor

jrasm91 commented Jan 12, 2023

I don't have a problem with it, just as long as it's clear it's not officially supported by Immich dev team and they should ask you question if they run into issues 😁

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

No branches or pull requests