-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Docker-less Alpine installation #556
Conversation
There are some tips to run Docker in LXC containers (playing with nesting option if I remember), although IMO it is not the best way to do. |
What are the reasons? |
Allowing a container to go out of its initial scope, even if sometimes it can be convenient, is not the good way just for running applications. In the same way as in Docker you could use |
Fair assessment. I was asking for my knowledge. You are welcome to implement the PR. I bet there are people that don't want to use Docker as a mean of deployment the app |
Great news, thanks! |
-h shows a help message with arguments accepted by the script --dev executes script with dev=1, portions of code can change their behavior while looking at dev's value.
Used for better looking while script is running.
Download immich release and extract it in temp directory. If in dev mode, the source code must be in the temp directory.
Configure database with a new password and a new database. The form ask if we want to use an external database, but it is not implemented. Some extensions are required
Services files for each component allows to start them on boot.
Service file to start on boot
All existing sites in /etc/nginx/http.d are disabled, so there are no conflicts for listening on 80 port.
Service file to start ML on boot. The upload folder is a symlink to the server's upload directory
If not in debug mode, the source code and the archive downloaded in the temp directory are deleted. As in debug mode, the source code has been provided, it is not removed.
There are still a few bugs with Alpine services. |
If flags aren't supported, the ML installation in skipped.
Shell scripts run node commands, these one cannot be managed by services. So when receiving a stop command, child processes are grepped and -kindly- killed. Also environment variables are needed for running server components.
Hey @alextran1502, I solved last bugs, you can try it yourself. I tried to implement machine-learning in Alpine. So for the moment, expected for ML, everything seems to work. Thanks for your feedback. |
Hi @Chiogros, your contribution is so interesting. Your scripts are quite readable as well. Would you mind if I give you some questions?
I also have a plan to create standalone docker image by using PM2. I hope I can re-use your script. |
Hi @panoti,
I first thought about the same architecture as you: However, every docker images used are alpine images, excepted for ML. Keeping docker/standalone OS the same would certainly be easier to maintain (same packages name, package manager, shell, ...). But it's a way we could try.
Yes, it's on my todo-list :) Thanks! |
I really like this organization because it may help us distinguish between service managers.
yeah, but I believe that it will make our source code become mess up if we have more kind of service managers like systemd, sysvinit, ....
Sound great, thank you. |
|
||
# Build stage | ||
echo "Installing build stage dependencies..." | ||
apk add --no-cache build-base python3 libheif vips-dev ffmpeg nodejs-current npm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is nodejs-current
always the lts
version of node?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it is better to perform node installation with the version specified in the Dockerfile to avoid unexpected behavior of the application
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkgs.org gives packages versions for nodejs on different Alpine versions.
The main nodejs
package is running node v14, where nodejs-current
is running v16, as in Dockerfiles.
Alpine 3.14 is going EOL in a few months, I don't think they will update nodejs-current
over v16.
When Dockerfiles's Alpine version will be updated, we will have to look at the right node
package compatible with Immich.
Thank you for the detail comments in each file. It helps a lot! I think we want to include an installation script for Debian/Ubuntu as well. What is your plan on this? |
I didn't started anything for Debian/Ubuntu, but I'll start as soon as everything will be okay for Alpine (except ML). There is one thing and a half to do to support another distro:
The longer will be the first one as you can imagine. |
web/Dockerfile has been updated, changes have been mirrored in the script.
Partly uninstall and delete immich components, then compile the updated versions.
node user now executes npm commands to set proper permissions on files without having to do chowns again and again. Services files now execute as the node user, a non privilegied user.
Hi, |
An external nginx server can be used. The configuration will not be applied locally, but a warning message will invite to check the repo to see the recommended nginx config.
Everything looks good to me. Can you write down some words for the testing procedure and the required environment to test? Thank you for your contribution! |
Give tips about script options and development procedures for future releases.
A chown on a symlink without trailing / will not apply on target directory. Also, a note has been added: the storage path should not end with a /.
Hope it is what you were looking for. |
@Chiogros Thank you, I will spin up an alpine VM and test then let you know the result. We probably need to move all of the instruction to the WIKI to keep things nice and clean in the readme. It is getting long :P |
Hello everybody, |
Hi,
The docker-based installation is not convenient for everyone.
For example, a docker-less installation would allow LXC/D containers usage, without using tricky tips for using Docker inside of them.
I already successfully installed a standalone Immich.
This branch would be used for scripting a command-line interactive installation.
Thanks for your feedback!