simplify_truths/Dockerfile
Martin Berg Alstad c1b9273e0c
Deploy with docker-compose (#1)
Deploy using docker-compose and GitHub Actions.

Created a simple get endpoint to check if server is running on /

Updated address from 127.0.0.1 to 0.0.0.0
2024-06-13 14:42:42 +02:00

30 lines
710 B
Docker

# Creates a new cargo project, copies the Cargo.toml and Cargo.lock files to the new project,
# builds the project, and then copies the built binary to a new image.
FROM rust:1.78 as build
LABEL authors="Martin Berg Alstad"
RUN USER=root cargo new --bin simplify_truths
WORKDIR /simplify_truths
COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
# this build step will cache your dependencies
RUN cargo build --release
RUN rm src/*.rs
COPY ./src ./src
RUN rm ./target/release/deps/simplify_truths*
RUN cargo build --release
FROM debian
# copy the build artifact from the build stage
COPY --from=build /simplify_truths/target/release/simplify_truths .
EXPOSE 8000
CMD ["./simplify_truths"]