fix: correctly set script permissions inside Docker container

This commit is contained in:
Elias Schneider
2025-05-06 21:18:45 +02:00
parent 6f54ee5d66
commit c55fef057c
2 changed files with 12 additions and 4 deletions

View File

@@ -46,7 +46,7 @@ COPY --from=frontend-builder /app/frontend/package.json ./frontend/package.json
COPY --from=backend-builder /app/backend/pocket-id-backend ./backend/pocket-id-backend
COPY ./scripts ./scripts
RUN chmod +x ./scripts/**/*.sh
RUN find ./scripts -name "*.sh" -exec chmod +x {} \;
EXPOSE 80
ENV APP_ENV=production

View File

@@ -1,3 +1,5 @@
#!/bin/sh
DB_PATH="./backend/data/pocket-id.db"
DB_PROVIDER="${DB_PROVIDER:=sqlite}"
@@ -32,8 +34,14 @@ check_and_install() {
local cmd=$1
local pkg=$2
if ! command -v "$cmd" &>/dev/null; then
if command -v apk &>/dev/null; then
if
! command -v "$cmd" &
>/dev/null
then
if
command -v apk &
>/dev/null
then
echo "$cmd not found. Installing..."
apk add "$pkg" --no-cache
else
@@ -105,4 +113,4 @@ else
echo "Error creating access token."
exit 1
fi
echo "================================================="
echo "================================================="