Merge pull request 'Remove the creation of the keys in the livekit middleware image' (#6) from holzi1005-patch-3 into main

Reviewed-on: #6
Reviewed-by: emanuel.holzmann <emanuel.holzmann@noreply.localhost>
This commit is contained in:
holzi1005 2024-11-26 16:26:11 +01:00
commit de59ab076c

View file

@ -18,14 +18,7 @@ LABEL version="${VERSION}" \
USER root USER root
RUN apk --no-cache add \ RUN apk --no-cache add \
unzip \ unzip
openssl
RUN echo "#!/bin/sh" > /docker-entrypoint-init.d/02-openssl.sh \
&& echo "openssl genrsa -out ${WEBDIR}/private.pem" >> /docker-entrypoint-init.d/02-openssl.sh \
&& echo "openssl rsa -in ${WEBDIR}/private.pem -pubout -out ${WEBDIR}/public/public.pem" >> /docker-entrypoint-init.d/02-openssl.sh \
&& echo "chown nobody ${WEBDIR}/private.pem" >> /docker-entrypoint-init.d/02-openssl.sh \
&& chmod +x /docker-entrypoint-init.d/*
RUN --mount=type=secret,id=ARTIFACT_USER \ RUN --mount=type=secret,id=ARTIFACT_USER \
--mount=type=secret,id=ARTIFACT_SECRET \ --mount=type=secret,id=ARTIFACT_SECRET \
@ -34,17 +27,14 @@ RUN --mount=type=secret,id=ARTIFACT_USER \
ARTIFACT_SECRET=$(cat /run/secrets/ARTIFACT_SECRET) \ ARTIFACT_SECRET=$(cat /run/secrets/ARTIFACT_SECRET) \
ARTIFACT_URL=$(cat /run/secrets/ARTIFACT_URL) \ ARTIFACT_URL=$(cat /run/secrets/ARTIFACT_URL) \
&& wget https://${ARTIFACT_USER}:${ARTIFACT_SECRET}@${ARTIFACT_URL}-${VERSION}.zip -O artifact.zip \ && wget https://${ARTIFACT_USER}:${ARTIFACT_SECRET}@${ARTIFACT_URL}-${VERSION}.zip -O artifact.zip \
&& unzip artifact.zip -d ${WEBDIR} \ && unzip artifact.zip \
&& chown -R nobody ${WEBDIR}/public \ && chown -R nobody public \
&& chown -R nobody ${WEBDIR}/var \ && chown -R nobody var \
&& chmod -R 700 ${WEBDIR}/public \ && chmod -R 700 public \
&& chmod -R 700 ${WEBDIR}/var && chmod -R 700 var \
&& rm artifact.zip
RUN apk del unzip \ RUN rm -r var/cache \
&& rm artifact.zip \
&& rm ${WEBDIR}/private.pem \
&& rm ${WEBDIR}/public/public.pem \
&& rm -r ${WEBDIR}/var/cache \
&& rm -rf /var/cache/apk/* && rm -rf /var/cache/apk/*
USER nobody USER nobody