diff --git a/Dockerfile b/Dockerfile index be9ba38..9525f05 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,11 @@ WORKDIR /app COPY backend/requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY backend/app ./app +COPY backend/alembic ./alembic +COPY backend/alembic.ini ./alembic.ini COPY --from=build /fe/dist ./app/static EXPOSE 8000 -CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] +# Apply migrations before boot. Both revisions are idempotent (0001 = create_all, +# 0002 = guarded add), so this is safe on a fresh DB and fixes a stale one. +CMD ["sh", "-c", "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8000"]