@@ -22,12 +22,13 @@ WORKDIR /app
2222# source code into the container. Once built, copy the executable to an
2323# output directory before the cache mounted /app/target is unmounted.
2424RUN --mount=type=bind,source=src,target=src \
25- --mount=type=bind,source=migrations,target=migrations \
26- --mount=type=bind,source=Cargo.toml,target=Cargo.toml \
27- --mount=type=bind,source=Cargo.lock,target=Cargo.lock \
28- --mount=type=cache,target=/app/target/ \
29- --mount=type=cache,target=/usr/local/cargo/registry/ \
30- <<EOF
25+ --mount=type=bind,source=migrations,target=migrations \
26+ --mount=type=bind,source=./.env,target=/app/.env \
27+ --mount=type=bind,source=Cargo.toml,target=Cargo.toml \
28+ --mount=type=bind,source=Cargo.lock,target=Cargo.lock \
29+ --mount=type=cache,target=/app/target/ \
30+ --mount=type=cache,target=/usr/local/cargo/registry/ \
31+ <<EOF
3132set -e
3233cargo build --locked --release
3334cp ./target/release/$APP_NAME /bin/server
@@ -50,13 +51,13 @@ FROM debian:bullseye-slim AS final
5051# See https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#user
5152ARG UID=10001
5253RUN adduser \
53- --disabled-password \
54- --gecos "" \
55- --home "/nonexistent" \
56- --shell "/sbin/nologin" \
57- --no-create-home \
58- --uid "${UID}" \
59- appuser
54+ --disabled-password \
55+ --gecos "" \
56+ --home "/nonexistent" \
57+ --shell "/sbin/nologin" \
58+ --no-create-home \
59+ --uid "${UID}" \
60+ appuser
6061USER appuser
6162
6263# Copy the executable from the "build" stage.
0 commit comments