2024-02-19 01:03:01 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-08-07 06:42:50 +02:00
|
|
|
echo "Starting Immich installation..."
|
|
|
|
|
|
|
|
ip_address=$(hostname -I | awk '{print $1}')
|
|
|
|
|
|
|
|
create_immich_directory() {
|
|
|
|
echo "Creating Immich directory..."
|
2024-03-18 23:54:30 +02:00
|
|
|
mkdir -p ./immich-app
|
2024-02-19 01:03:01 +02:00
|
|
|
cd ./immich-app || exit
|
2022-08-07 06:42:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
download_docker_compose_file() {
|
|
|
|
echo "Downloading docker-compose.yml..."
|
2023-04-02 21:13:24 +02:00
|
|
|
curl -L https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml -o ./docker-compose.yml >/dev/null 2>&1
|
2022-08-07 06:42:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
download_dot_env_file() {
|
|
|
|
echo "Downloading .env file..."
|
2023-04-02 21:13:24 +02:00
|
|
|
curl -L https://github.com/immich-app/immich/releases/latest/download/example.env -o ./.env >/dev/null 2>&1
|
2022-08-07 06:42:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
start_docker_compose() {
|
|
|
|
echo "Starting Immich's docker containers"
|
|
|
|
|
2024-02-19 04:57:24 +02:00
|
|
|
if docker compose >/dev/null 2>&1; then
|
2022-09-10 18:48:50 +02:00
|
|
|
docker_bin="docker compose"
|
2024-02-19 04:57:24 +02:00
|
|
|
elif docker-compose >/dev/null 2>&1; then
|
2022-09-10 18:48:50 +02:00
|
|
|
docker_bin="docker-compose"
|
|
|
|
else
|
2024-02-19 01:03:01 +02:00
|
|
|
echo "Cannot find \`docker compose\` or \`docker-compose\`."
|
2022-09-10 18:48:50 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2022-08-07 06:42:50 +02:00
|
|
|
|
2022-09-10 18:48:50 +02:00
|
|
|
if $docker_bin up --remove-orphans -d; then
|
2022-08-07 06:42:50 +02:00
|
|
|
show_friendly_message
|
|
|
|
exit 0
|
2022-09-10 18:48:50 +02:00
|
|
|
else
|
|
|
|
echo "Could not start. Check for errors above."
|
|
|
|
exit 1
|
2022-08-07 06:42:50 +02:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
show_friendly_message() {
|
2024-02-14 10:48:59 +02:00
|
|
|
echo "Successfully deployed Immich!"
|
2022-08-07 06:42:50 +02:00
|
|
|
echo "You can access the website at http://$ip_address:2283 and the server URL for the mobile app is http://$ip_address:2283/api"
|
|
|
|
echo "---------------------------------------------------"
|
2022-09-14 13:53:34 +02:00
|
|
|
echo "If you want to configure custom information of the server, including the database, Redis information, or the backup (or upload) location, etc.
|
2022-08-07 06:42:50 +02:00
|
|
|
|
|
|
|
1. First bring down the containers with the command 'docker-compose down' in the immich-app directory,
|
|
|
|
|
|
|
|
2. Then change the information that fits your needs in the '.env' file,
|
|
|
|
|
|
|
|
3. Finally, bring the containers back up with the command 'docker-compose up --remove-orphans -d' in the immich-app directory"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
# MAIN
|
|
|
|
create_immich_directory
|
|
|
|
download_docker_compose_file
|
|
|
|
download_dot_env_file
|
|
|
|
start_docker_compose
|