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
This commit is contained in:
Daleth Darko 2024-01-10 23:57:43 -05:00 committed by GitHub
parent c4d96e8ee2
commit 978eb92781
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -22,7 +22,8 @@ ENV USER=container \
HOME=/home/container \ HOME=/home/container \
NODE_ENV=production \ NODE_ENV=production \
HTTP_HOST=0.0.0.0 \ HTTP_HOST=0.0.0.0 \
HTTP_PORT=80 HTTP_PORT=80 \
DOCKER=true
WORKDIR /home/container WORKDIR /home/container
COPY --from=builder --chown=container:container /build /app COPY --from=builder --chown=container:container /build /app
EXPOSE ${HTTP_PORT}/tcp EXPOSE ${HTTP_PORT}/tcp

View File

@ -1,7 +1,10 @@
#!/usr/bin/env bash #!/usr/bin/env sh
if [ "$DOCKER" = "true" ]; then
source="${BASH_SOURCE}" base_dir="/app"
base_dir=$(dirname $(dirname "$source")) else
source="${BASH_SOURCE}"
base_dir=$(dirname $(dirname "$source"))
fi
echo "Checking environment..." echo "Checking environment..."
script=scripts/preinstall script=scripts/preinstall