Updated auth to use pem keys instead of base64 keys in strings?

This commit is contained in:
2023-11-21 08:01:32 -05:00
parent 0dad6be93d
commit cb9db1f3ba
17 changed files with 86 additions and 120 deletions

View File

@@ -11,14 +11,26 @@ COPY Cargo.toml ./
RUN apt-get update && apt-get install -y cmake
RUN cargo build --release
# ======
# Keys
# ======
FROM debian:bookworm-slim as keys
WORKDIR /keys
RUN apt-get update && apt-get install -y openssl libpq-dev
RUN openssl genrsa -out access.pem 4096
RUN openssl rsa -in access.pem -pubout -outform PEM -out access.pem.pub
RUN openssl genrsa -out refresh.pem 4096
RUN openssl rsa -in refresh.pem -pubout -outform PEM -out refresh.pem.pub
# =========
# Runtime
# =========
FROM debian:bookworm-slim as runtime
FROM keys as runtime
WORKDIR /service
USER root
COPY --from=builder /builder/target/release/service /usr/local/bin/service
COPY --from=packages /packages /usr/bin
COPY --from=keys /keys /keys
CMD ["service"]