31 lines
725 B
Docker
31 lines
725 B
Docker
FROM rust:1.90-slim-trixie AS build
|
|
|
|
ENV PKG_CONFIG_ALLOW_CROSS=1
|
|
ENV SCCACHE_DIR=/build-cache
|
|
ENV RUSTC_WRAPPER=sccache
|
|
|
|
WORKDIR .
|
|
COPY ./api ./api
|
|
COPY ./libseptastic/ ./libseptastic/
|
|
COPY ./api/assets ./assets
|
|
COPY ./api/templates ./templates
|
|
|
|
|
|
RUN apt -y update && apt install -y libssl-dev libc-dev sccache build-essential pkg-config
|
|
RUN cd api && cargo build --release
|
|
|
|
FROM debian:trixie-slim
|
|
WORKDIR /app
|
|
|
|
EXPOSE 8080
|
|
COPY --from=build /api/target/release/septastic_api /app/septastic_api
|
|
COPY --from=build /api/config.yaml /app/config.yaml
|
|
COPY api/assets /app/assets
|
|
COPY api/templates /app/templates
|
|
|
|
RUN apt -y update && apt install -y curl
|
|
|
|
ENV RUST_LOG=info
|
|
ENV EXPOSE_PORT=8080
|
|
|
|
ENTRYPOINT ["./septastic_api"]
|