Add entrypoint.sh: wait for MariaDB before starting Flask

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Nirodan
2026-05-06 09:37:01 +02:00
parent 75062dbf5e
commit dedde400e1
2 changed files with 40 additions and 1 deletions
+5 -1
View File
@@ -19,6 +19,7 @@ COPY backend/templates ./backend/templates
# Store DB config in a docker-friendly location (/config), override via DB_CONFIG_PATH env if needed
COPY backend/config /config
COPY backend/requirements.txt ./requirements.txt
COPY backend/entrypoint.sh ./entrypoint.sh
# Frontend aus Build-Stage übernehmen
COPY --from=frontend-build /app/frontend/dist ./frontend/dist
@@ -26,9 +27,12 @@ COPY --from=frontend-build /app/frontend/dist ./frontend/dist
# Python-Abhängigkeiten installieren
RUN pip install --no-cache-dir -r requirements.txt
# Entrypoint ausführbar machen
RUN chmod +x /app/entrypoint.sh
# Flask starten
WORKDIR /app/backend
ENV PYTHONPATH=/app/backend
ENV DB_CONFIG_PATH=/config/db_config.json
EXPOSE 5000
CMD ["python", "app.py"]
ENTRYPOINT ["/app/entrypoint.sh"]