From 58aac857584d83b80498d6f27a806ba810b645c5 Mon Sep 17 00:00:00 2001 From: abdulhade Date: Sun, 6 Apr 2025 12:47:42 +0300 Subject: [PATCH] Moved database migrations to `run.sh` script. --- Dockerfile | 6 ++---- scripts/run.sh | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4710513..bb7e810 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,9 +23,7 @@ RUN pip install --upgrade pip && pip install --no-cache-dir -r /tmp/requirements COPY . . -RUN rm files/db.sqlite -f - -RUN /usr/local/bin/alembic -c alembic/alembic.ini upgrade head +# RUN /usr/local/bin/alembic -c alembic/alembic.ini upgrade head # Change ownership to the new user RUN chown -R appuser:appuser /app @@ -34,4 +32,4 @@ RUN chown -R appuser:appuser /app USER appuser -CMD ["bash", "/app/scripts/run.sh"] +ENTRYPOINT ["/app/scripts/run.sh"] diff --git a/scripts/run.sh b/scripts/run.sh index 68ccc85..ed6c468 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -1,4 +1,5 @@ #!/bin/bash +alembic -c alembic/alembic.ini upgrade head uvicorn main:app --host $API_HOST --port $API_PORT \ No newline at end of file