ph4 #38

Merged
mo merged 5 commits from ph4 into prod 2025-06-01 19:19:21 +02:00
3 changed files with 14 additions and 1 deletions
Showing only changes of commit c50395ae86 - Show all commits

View File

@ -49,6 +49,8 @@ COPY --chown=appuser:appuser alembic/ ./alembic/
COPY --chown=appuser:appuser alembic.ini ./
COPY --chown=appuser:appuser *.py ./
COPY --chown=appuser:appuser requirements.txt ./
COPY --chown=appuser:appuser entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
# Create logs directory
RUN mkdir -p /app/logs && chown -R appuser:appuser /app
@ -64,6 +66,7 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
EXPOSE 8000
# Production command
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["uvicorn", "app.main:app", \
"--host", "0.0.0.0", \
"--port", "8000", \

10
be/entrypoint.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
set -e
# Run database migrations
echo "Running database migrations..."
alembic upgrade head
# Execute the command passed as arguments to this script
echo "Starting application..."
exec "$@"

View File

@ -33,7 +33,7 @@ services:
# Pass the database URL to the backend container
# Uses the service name 'db' as the host, and credentials defined above
# IMPORTANT: Use the correct async driver prefix if your app needs it!
- DATABASE_URL=xxx
- DATABASE_URL=postgresql+asyncpg://mitlist_owner:npg_p0SkmyJ6BPWO@ep-small-sound-a9ketcef-pooler.gwc.azure.neon.tech/testnewmig
- GEMINI_API_KEY=xxx
- SECRET_KEY=xxx
# Add other environment variables needed by the backend here