[fix]. Run migrations before app startup
All checks were successful
ci / test (push) Successful in 27s
ci / publish (push) Successful in 1m6s

This commit is contained in:
Space-Banane
2026-05-22 23:15:59 +02:00
parent 729ea4aae4
commit eb00deb323
2 changed files with 11 additions and 1 deletions

View File

@@ -11,8 +11,10 @@ COPY pyproject.toml README.md /app/
COPY src /app/src COPY src /app/src
COPY alembic.ini /app/ COPY alembic.ini /app/
COPY alembic /app/alembic COPY alembic /app/alembic
COPY docker/entrypoint.sh /app/docker/entrypoint.sh
RUN pip install --no-cache-dir . RUN pip install --no-cache-dir .
RUN chmod +x /app/docker/entrypoint.sh
EXPOSE 8000 EXPOSE 8000
CMD ["uvicorn", "gitea_codex_bot.main:app", "--host", "0.0.0.0", "--port", "8000"] CMD ["/app/docker/entrypoint.sh"]

8
docker/entrypoint.sh Normal file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
set -eu
echo "Running database migrations..."
alembic upgrade head
echo "Starting API server..."
exec uvicorn gitea_codex_bot.main:app --host 0.0.0.0 --port 8000