feat: add dockerfile
This commit is contained in:
@@ -23,10 +23,13 @@ WORKDIR /app
|
|||||||
COPY Cargo.toml Cargo.lock ./
|
COPY Cargo.toml Cargo.lock ./
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
COPY scp_core ./scp_core
|
COPY scp_core ./scp_core
|
||||||
|
COPY .sqlx ./.sqlx
|
||||||
|
COPY migrations ./migrations
|
||||||
|
|
||||||
# If you have a workspace / extra crates, copy them too (adjust):
|
# If you have a workspace / extra crates, copy them too (adjust):
|
||||||
# COPY crates ./crates
|
# COPY crates ./crates
|
||||||
|
|
||||||
|
ENV SQLX_OFFLINE=true
|
||||||
RUN cargo build --release
|
RUN cargo build --release
|
||||||
|
|
||||||
# ---- Runtime image ----
|
# ---- Runtime image ----
|
||||||
@@ -38,12 +41,12 @@ RUN apt-get update \
|
|||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Adjust binary name
|
# 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
|
# Match your Actix static path: ./frontend/dist
|
||||||
COPY --from=frontend-build /app/frontend/dist /app/frontend/dist
|
COPY --from=frontend-build /app/frontend/dist /app/frontend/dist
|
||||||
|
|
||||||
ENV RUST_LOG=info
|
ENV RUST_LOG=info
|
||||||
ENV HOST=0.0.0.0
|
ENV HOST=0.0.0.0
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
CMD ["/app/myapp"]
|
CMD ["/app/cupcontrol"]
|
||||||
|
|||||||
Reference in New Issue
Block a user