start.sh removed

This commit is contained in:
2025-06-04 08:15:16 +02:00
parent 75ce618091
commit 12ecaef5d1
2 changed files with 26 additions and 33 deletions

View File

@@ -6,7 +6,6 @@ RUN apt-get update && apt-get install -y \
libpq-dev \
curl \
netcat-traditional \
dos2unix \
&& rm -rf /var/lib/apt/lists/*
# Create a non-root user
@@ -15,11 +14,6 @@ RUN useradd -m -u 1000 celery
# Set working directory
WORKDIR /app
# Copy start.sh first and set permissions
COPY start.sh .
RUN dos2unix start.sh && \
chmod +x start.sh
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
@@ -31,8 +25,32 @@ COPY . .
RUN mkdir -p /app/uploads /app/static/uploads && \
chown -R celery:celery /app
# Create startup script
RUN echo '#!/bin/sh\n\
echo "Waiting for database..."\n\
while ! nc -z db 5432; do\n\
sleep 0.1\n\
done\n\
echo "Database is ready!"\n\
\n\
echo "Waiting for Redis..."\n\
while ! nc -z redis 6379; do\n\
sleep 0.1\n\
done\n\
echo "Redis is ready!"\n\
\n\
echo "Running database migrations..."\n\
flask db upgrade\n\
\n\
echo "Creating admin user..."\n\
flask create-admin\n\
\n\
echo "Starting application..."\n\
exec "$@"' > /app/entrypoint.sh && \
chmod +x /app/entrypoint.sh
# Switch to non-root user
USER celery
# Set entrypoint using shell form
ENTRYPOINT ./start.sh
# Set entrypoint
ENTRYPOINT ["/bin/sh", "/app/entrypoint.sh"]

View File

@@ -1,25 +0,0 @@
#!/usr/bin/env bash
set -e
echo "Starting DocuPulse..."
echo "Waiting for database..."
while ! nc -z db 5432; do
sleep 0.1
done
echo "Database is ready!"
echo "Waiting for Redis..."
while ! nc -z redis 6379; do
sleep 0.1
done
echo "Redis is ready!"
echo "Running database migrations..."
flask db upgrade
echo "Creating admin user..."
flask create-admin
echo "Starting application..."
exec "$@"