mirror of
https://github.com/2martens/cloud-configuration.git
synced 2026-10-17 08:37:56 +02:00
fix: Generate ssl certificates in builder image
This commit is contained in:
@@ -1,16 +1,24 @@
|
||||
FROM alpine AS cert-builder
|
||||
|
||||
RUN apk add --no-cache openssl
|
||||
|
||||
# Generate certs during build
|
||||
RUN mkdir -p /tmp/ssl && \
|
||||
openssl req -x509 -nodes -days 365 \
|
||||
-newkey rsa:2048 \
|
||||
-keyout /tmp/ssl/selfsigned.key \
|
||||
-out /tmp/ssl/selfsigned.crt \
|
||||
-subj "/CN=localhost"
|
||||
|
||||
FROM nginx:mainline-alpine
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY paths-enabled /etc/nginx/paths-enabled.d
|
||||
|
||||
RUN mkdir -p /etc/nginx/ssl && \
|
||||
openssl req -x509 -nodes -days 365 \
|
||||
-newkey rsa:2048 \
|
||||
-subj "/CN=localhost" \
|
||||
-keyout /etc/nginx/ssl/selfsigned.key \
|
||||
-out /etc/nginx/ssl/selfsigned.crt \
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
COPY --from=cert-builder /tmp/ssl/selfsigned.crt /etc/nginx/ssl/selfsigned.crt
|
||||
COPY --from=cert-builder /tmp/ssl/selfsigned.key /etc/nginx/ssl/selfsigned.key
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
Reference in New Issue
Block a user