2021-07-06 17:00:16 +00:00
|
|
|
FROM rust:buster AS base
|
2020-03-26 09:39:45 +00:00
|
|
|
|
2020-03-23 13:00:43 +00:00
|
|
|
ENV USER=root
|
|
|
|
ENV ROCKET_ADDRESS=0.0.0.0
|
2020-03-26 09:39:45 +00:00
|
|
|
ENV ROCKET_ENV=development
|
2020-03-23 13:00:43 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2020-03-26 09:39:45 +00:00
|
|
|
ENV ROCKET_ENV=production
|
|
|
|
|
2020-03-23 13:00:43 +00:00
|
|
|
EXPOSE 8000
|
|
|
|
|
|
|
|
COPY --from=builder /code/target/release/react-rust-postgres /react-rust-postgres
|
|
|
|
|
|
|
|
CMD [ "/react-rust-postgres" ]
|