You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
501 B
Docker

FROM rust:buster AS base
ENV USER=root
ENV ROCKET_ADDRESS=0.0.0.0
ENV ROCKET_ENV=development
WORKDIR /code
RUN cargo init
COPY Cargo.toml /code/Cargo.toml
RUN cargo fetch
COPY . /code
FROM base AS development
EXPOSE 8000
CMD [ "cargo", "run", "--offline" ]
FROM base AS builder
RUN cargo build --release --offline
FROM debian:buster-slim
ENV ROCKET_ENV=production
EXPOSE 8000
COPY --from=builder /code/target/release/react-rust-postgres /react-rust-postgres
CMD [ "/react-rust-postgres" ]