@@ -21,16 +21,16 @@ RUN --mount=type=cache,target=/root/.cache \
2121 --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
2222 uv sync --locked --no-dev --no-install-project
2323
24- COPY . /src
25- WORKDIR /src
24+ COPY ./src /src
2625
2726# Install the application into the build environment.
2827# We won't need the source code in the production image,
2928# only the installed packages.
3029RUN --mount=type=cache,target=/root/.cache \
30+ --mount=type=bind,source=uv.lock,target=uv.lock \
31+ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
3132 uv sync --locked --no-dev --no-editable
3233
33-
3434FROM python AS app
3535
3636# Add the virtualenv to PATH
@@ -40,12 +40,12 @@ ENV PATH="/app/bin:${PATH}"
4040RUN addgroup -S nonroot && adduser -S nonroot -G nonroot
4141
4242# Copy the pre-built /app virtualenv and change ownership to nonroot
43- COPY --from=builder --chown=nonroot:nonroot /app /app
43+ COPY --from=builder --chown=nonroot:nonroot --chmod=500 /app /app
4444
4545USER nonroot:nonroot
4646WORKDIR /app
4747
4848ENV SERVER_BASE_PATH="/home/nonroot/assets"
49- CMD ["uvicorn " , "bss_web_file_server.main:app " , "--host " , "0.0.0.0" , "--port" , "8080 " ]
49+ CMD ["fastapi " , "run " , "--entrypoint " , "bss_web_file_server.main:app " ]
5050
51- EXPOSE 8080
51+ EXPOSE 8000
0 commit comments