mirror of
https://github.com/fastapi/full-stack-fastapi-template.git
synced 2026-11-03 20:36:27 +00:00
♻️ Serve frontend from FastAPI (#2393)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
588dfd46e5
commit
e80d92452e
@@ -1,3 +1,21 @@
|
||||
FROM oven/bun:1 AS frontend-build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json bun.lock /app/
|
||||
COPY frontend/package.json /app/frontend/
|
||||
|
||||
WORKDIR /app/frontend
|
||||
|
||||
RUN bun install
|
||||
|
||||
COPY ./frontend /app/frontend
|
||||
|
||||
ARG VITE_API_URL=
|
||||
|
||||
RUN bun run build
|
||||
|
||||
|
||||
FROM python:3.14
|
||||
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
@@ -33,6 +51,8 @@ COPY ./backend/pyproject.toml ./backend/alembic.ini /app/backend/
|
||||
|
||||
COPY ./backend/app /app/backend/app
|
||||
|
||||
COPY --from=frontend-build /app/backend/app/frontend /app/backend/app/frontend
|
||||
|
||||
# Sync the project
|
||||
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers
|
||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||
|
||||
Reference in New Issue
Block a user