Skip to content

Commit

Permalink
Merge branch 'master' into zoltanszepesi/libiam-login-user
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoDCube authored Nov 27, 2023
2 parents 071bebc + 466ee56 commit bdcf838
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
13 changes: 6 additions & 7 deletions 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 @@ -36,15 +35,15 @@ RUN rm target/release/deps/iam* \
target/release/deps/libiam* && \
cargo build --release

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

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"]

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 bdcf838

Please sign in to comment.