1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00

чиним билд17

This commit is contained in:
MoonTestUse1
2025-01-02 00:55:37 +06:00
parent fa1f027711
commit dc69508f1c
3 changed files with 14 additions and 24 deletions

View File

@@ -19,8 +19,17 @@ RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Create script to run migrations and start app
RUN echo '#!/bin/sh\n\
echo "Waiting for database..."\n\
sleep 5\n\
echo "Running migrations..."\n\
alembic upgrade head\n\
echo "Starting application..."\n\
python run.py' > /app/start.sh && chmod +x /app/start.sh
# Expose port
EXPOSE 8000
# Run migrations and start application
CMD ["sh", "-c", "alembic upgrade head && python run.py"]
CMD ["/app/start.sh"]