mirror of
https://github.com/docker/awesome-compose.git
synced 2025-04-25 18:28:07 +02:00
react-rust-postgres: create simple server
Signed-off-by: Jérémie Drouet <jeremie.drouet@gmail.com>
This commit is contained in:
parent
4478c5c142
commit
bdd0256bfc
6 changed files with 91 additions and 0 deletions
28
react-rust-postgres/backend/Dockerfile
Normal file
28
react-rust-postgres/backend/Dockerfile
Normal file
|
@ -0,0 +1,28 @@
|
|||
FROM jdrouet/rust-nightly:buster-slim AS base
|
||||
|
||||
ENV USER=root
|
||||
ENV ROCKET_ADDRESS=0.0.0.0
|
||||
|
||||
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
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
COPY --from=builder /code/target/release/react-rust-postgres /react-rust-postgres
|
||||
|
||||
CMD [ "/react-rust-postgres" ]
|
Loading…
Add table
Add a link
Reference in a new issue