Fix jwt-token
This commit is contained in:
@@ -7,7 +7,8 @@ RUN apk add --no-cache \
|
|||||||
make \
|
make \
|
||||||
g++ \
|
g++ \
|
||||||
curl \
|
curl \
|
||||||
dumb-init
|
dumb-init \
|
||||||
|
netcat-openbsd
|
||||||
|
|
||||||
# Set working directory
|
# Set working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|||||||
@@ -7,5 +7,25 @@ mkdir -p /app/uploads/logos
|
|||||||
chown -R nodejs:nodejs /app/uploads
|
chown -R nodejs:nodejs /app/uploads
|
||||||
chmod -R 755 /app/uploads
|
chmod -R 755 /app/uploads
|
||||||
|
|
||||||
|
# Wait for database to be ready
|
||||||
|
echo "Waiting for database to be ready..."
|
||||||
|
while ! nc -z database 5432; do
|
||||||
|
echo "Database not ready, waiting..."
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
echo "Database is ready!"
|
||||||
|
|
||||||
|
# Run database migrations as nodejs user
|
||||||
|
echo "Running database migrations..."
|
||||||
|
su-exec nodejs npm run db:migrate
|
||||||
|
|
||||||
|
# Check if migrations were successful
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "Database migrations completed successfully"
|
||||||
|
else
|
||||||
|
echo "Database migrations failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Switch to nodejs user and execute the command with dumb-init for signal handling
|
# Switch to nodejs user and execute the command with dumb-init for signal handling
|
||||||
exec su-exec nodejs dumb-init -- "$@"
|
exec su-exec nodejs dumb-init -- "$@"
|
||||||
Reference in New Issue
Block a user