feat: add dockerfile

This commit is contained in:
2025-12-26 01:32:23 +01:00
parent 3be3fe5c82
commit 6c8fd8e3d3

View File

@@ -23,10 +23,13 @@ WORKDIR /app
COPY Cargo.toml Cargo.lock ./
COPY src ./src
COPY scp_core ./scp_core
COPY .sqlx ./.sqlx
COPY migrations ./migrations
# If you have a workspace / extra crates, copy them too (adjust):
# COPY crates ./crates
ENV SQLX_OFFLINE=true
RUN cargo build --release
# ---- Runtime image ----
@@ -38,12 +41,12 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/*
# Adjust binary name
COPY --from=backend-build /app/target/release/myapp /app/myapp
COPY --from=backend-build /app/target/release/cupcontrol /app/cupcontrol
COPY --from=backend-build /app/migrations /app/migrations
# Match your Actix static path: ./frontend/dist
COPY --from=frontend-build /app/frontend/dist /app/frontend/dist
ENV RUST_LOG=info
ENV HOST=0.0.0.0
EXPOSE 8080
CMD ["/app/myapp"]
CMD ["/app/cupcontrol"]