build: optimize the production Dockerfile
This commit is contained in:
parent
d41879d8ed
commit
409a8fa2a9
@ -1,4 +1,4 @@
|
|||||||
FROM rust:1.80-bookworm as builder
|
FROM rust:1.80-bookworm AS builder
|
||||||
|
|
||||||
RUN rustup target add wasm32-unknown-unknown && \
|
RUN rustup target add wasm32-unknown-unknown && \
|
||||||
cargo install dioxus-cli diesel_cli && \
|
cargo install dioxus-cli diesel_cli && \
|
||||||
@ -16,7 +16,14 @@ FROM debian:bookworm-slim AS runner
|
|||||||
RUN apt-get update && apt-get install -y libpq5
|
RUN apt-get update && apt-get install -y libpq5
|
||||||
|
|
||||||
COPY --from=builder /srv/app/dist /srv/app/dist
|
COPY --from=builder /srv/app/dist /srv/app/dist
|
||||||
COPY ./.env /srv/app/.env
|
COPY .env /srv/app/.env
|
||||||
|
|
||||||
|
RUN chown -R 1000:1000 /srv/app
|
||||||
|
|
||||||
WORKDIR /srv/app
|
WORKDIR /srv/app
|
||||||
|
|
||||||
|
HEALTHCHECK CMD curl --fail http://localhost:8000 || exit 1
|
||||||
|
|
||||||
|
USER 1000:1000
|
||||||
|
|
||||||
CMD ["./dist/todo-baggins"]
|
CMD ["./dist/todo-baggins"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user