Skip to content

Commit

Permalink
change migration.Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoDCube committed Nov 24, 2023
1 parent 736eb11 commit bac2bd4
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions dockerfiles/migration.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
FROM rust:alpine as builder
FROM rust:slim-bookworm as builder

RUN apk add musl-dev
WORKDIR /builder
RUN cargo new --bin app && \
cargo new --bin app/iam && \
Expand Down Expand Up @@ -35,14 +34,14 @@ RUN rm target/release/deps/iam* \
target/release/deps/libiam* && \
cargo build -p iam-migration --release

FROM alpine
FROM debian:12-slim
WORKDIR /app
COPY --from=builder /builder/app/target/release/iam-migration ./

RUN addgroup -S iam && \
adduser -S -D -H -s /bin/false -G iam iam && \
chown -R iam:iam /app
USER iam
RUN addgroup --system app && \
adduser --system --disabled-password --no-create-home --shell /bin/false --ingroup app app && \
chown -R app:app /app
USER app

CMD ["./iam-migration"]

0 comments on commit bac2bd4

Please sign in to comment.