From 978eb9278168ef91cc4809e52a1deb1979a47001 Mon Sep 17 00:00:00 2001 From: Daleth Darko Date: Wed, 10 Jan 2024 23:57:43 -0500 Subject: [PATCH] fix(docker): start script (#513) * Denote to the system environment that it is running in docker * Fix start script to use sh instead of bash and check if in docker --- Dockerfile | 3 ++- scripts/start.sh | 11 +++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6d1b998..83c8282 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,8 @@ ENV USER=container \ HOME=/home/container \ NODE_ENV=production \ HTTP_HOST=0.0.0.0 \ - HTTP_PORT=80 + HTTP_PORT=80 \ + DOCKER=true WORKDIR /home/container COPY --from=builder --chown=container:container /build /app EXPOSE ${HTTP_PORT}/tcp diff --git a/scripts/start.sh b/scripts/start.sh index fb9728c..f1e1c72 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -1,7 +1,10 @@ -#!/usr/bin/env bash - -source="${BASH_SOURCE}" -base_dir=$(dirname $(dirname "$source")) +#!/usr/bin/env sh +if [ "$DOCKER" = "true" ]; then + base_dir="/app" +else + source="${BASH_SOURCE}" + base_dir=$(dirname $(dirname "$source")) +fi echo "Checking environment..." script=scripts/preinstall