Dockerfile 468 B

12345678910111213141516171819202122232425262728
  1. FROM jdrouet/rust-nightly:buster-slim AS base
  2. ENV USER=root
  3. ENV ROCKET_ADDRESS=0.0.0.0
  4. WORKDIR /code
  5. RUN cargo init
  6. COPY Cargo.toml /code/Cargo.toml
  7. RUN cargo fetch
  8. COPY . /code
  9. FROM base AS development
  10. EXPOSE 8000
  11. CMD [ "cargo", "run", "--offline" ]
  12. FROM base AS builder
  13. RUN cargo build --release --offline
  14. FROM debian:buster-slim
  15. EXPOSE 8000
  16. COPY --from=builder /code/target/release/react-rust-postgres /react-rust-postgres
  17. CMD [ "/react-rust-postgres" ]