mirror of
https://github.com/immich-app/immich.git
synced 2025-01-02 12:48:35 +02:00
fix: shell scripts (#7189)
* fix: bash scripts * fix: use bash * fix: e2e
This commit is contained in:
parent
ddae707ea9
commit
66d3daa074
@ -38,9 +38,9 @@ populate_upload_location() {
|
|||||||
start_docker_compose() {
|
start_docker_compose() {
|
||||||
echo "Starting Immich's docker containers"
|
echo "Starting Immich's docker containers"
|
||||||
|
|
||||||
if docker compose > /dev/null 2>&1; then
|
if docker compose >/dev/null 2>&1; then
|
||||||
docker_bin="docker compose"
|
docker_bin="docker compose"
|
||||||
elif docker-compose > /dev/null 2>&1; then
|
elif docker-compose >/dev/null 2>&1; then
|
||||||
docker_bin="docker-compose"
|
docker_bin="docker-compose"
|
||||||
else
|
else
|
||||||
echo "Cannot find \`docker compose\` or \`docker-compose\`."
|
echo "Cannot find \`docker compose\` or \`docker-compose\`."
|
||||||
|
@ -59,4 +59,4 @@ COPY LICENSE /LICENSE
|
|||||||
ENV PATH="${PATH}:/usr/src/app/bin"
|
ENV PATH="${PATH}:/usr/src/app/bin"
|
||||||
VOLUME /usr/src/app/upload
|
VOLUME /usr/src/app/upload
|
||||||
EXPOSE 3001
|
EXPOSE 3001
|
||||||
ENTRYPOINT ["tini", "--", "/bin/sh"]
|
ENTRYPOINT ["tini", "--", "/bin/bash"]
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
./start.sh microservices
|
./start.sh microservices
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
./start.sh immich
|
./start.sh immich
|
||||||
|
@ -1,42 +1,17 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
lib_path="/usr/lib/$(arch)-linux-gnu/libmimalloc.so.2"
|
read_file_and_export() {
|
||||||
export LD_PRELOAD="$lib_path"
|
if [ -n "${!1}" ]; then
|
||||||
|
content="$(cat "${!1}")"
|
||||||
if [ "$DB_URL_FILE" ]; then
|
export "$2"="${content}"
|
||||||
DB_URL_CONTENT=$(cat "$DB_URL_FILE")
|
unset "$1"
|
||||||
export DB_URL="$DB_URL_CONTENT"
|
fi
|
||||||
unset DB_URL_FILE
|
}
|
||||||
fi
|
read_file_and_export "DB_URL_FILE" "DB_URL"
|
||||||
|
read_file_and_export "DB_HOSTNAME_FILE" "DB_HOSTNAME"
|
||||||
if [ "$DB_HOSTNAME_FILE" ]; then
|
read_file_and_export "DB_DATABASE_NAME_FILE" "DB_DATABASE_NAME"
|
||||||
DB_HOSTNAME_CONTENT=$(cat "$DB_HOSTNAME_FILE")
|
read_file_and_export "DB_USERNAME_FILE" "DB_USERNAME"
|
||||||
export DB_HOSTNAME="$DB_HOSTNAME_CONTENT"
|
read_file_and_export "DB_PASSWORD_FILE" "DB_PASSWORD"
|
||||||
unset DB_HOSTNAME_FILE
|
read_file_and_export "REDIS_PASSWORD_FILE" "REDIS_PASSWORD"
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$DB_DATABASE_NAME_FILE" ]; then
|
|
||||||
DB_DATABASE_CONTENT=$(cat "$DB_DATABASE_NAME_FILE")
|
|
||||||
export DB_DATABASE_NAME="$DB_DATABASE_CONTENT"
|
|
||||||
unset DB_DATABASE_NAME_FILE
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$DB_USERNAME_FILE" ]; then
|
|
||||||
DB_USERNAME_CONTENT=$(cat "$DB_USERNAME_FILE")
|
|
||||||
export DB_USERNAME="$DB_USERNAME_CONTENT"
|
|
||||||
unset DB_USERNAME_FILE
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$DB_PASSWORD_FILE" ]; then
|
|
||||||
DB_PASSWORD_CONTENT=$(cat "$DB_PASSWORD_FILE")
|
|
||||||
export DB_PASSWORD="$DB_PASSWORD_CONTENT"
|
|
||||||
unset DB_PASSWORD_FILE
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$REDIS_PASSWORD_FILE" ]; then
|
|
||||||
REDIS_PASSWORD_CONTENT=$(cat "$REDIS_PASSWORD_FILE")
|
|
||||||
export DB_PASSWORD="$REDIS_PASSWORD_CONTENT"
|
|
||||||
unset REDIS_PASSWORD_FILE
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec node /usr/src/app/dist/main "$@"
|
exec node /usr/src/app/dist/main "$@"
|
||||||
|
Loading…
Reference in New Issue
Block a user