From ad82f9115bbc31ed4819e7233b24e81892a984b2 Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Thu, 28 Nov 2024 16:05:07 +0100 Subject: [PATCH] add new command for init container --- livekit_middleware_dockerfile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/livekit_middleware_dockerfile b/livekit_middleware_dockerfile index cc22f03..c5c7f6d 100644 --- a/livekit_middleware_dockerfile +++ b/livekit_middleware_dockerfile @@ -18,7 +18,14 @@ LABEL version="${VERSION}" \ USER root RUN apk --no-cache add \ - unzip + unzip \ + && rm -rf /var/cache/apk/* + +RUN echo "#!/bin/sh" > /docker-entrypoint-init.d/02-symfony.sh \ + && echo "php bin/console cache:clear" >> /docker-entrypoint-init.d/02-symfony.sh \ + && echo "php bin/console cache:warmup" >> /docker-entrypoint-init.d/02-symfony.sh \ + && echo "php bin/console fos:js-routing:dump --format=json --target=assets/data/fos_routes.json" >> /docker-entrypoint-init.d/02-symfony.sh \ + && chmod +x /docker-entrypoint-init.d/02-symfony.sh RUN --mount=type=secret,id=ARTIFACT_USER \ --mount=type=secret,id=ARTIFACT_SECRET \ @@ -32,10 +39,8 @@ RUN --mount=type=secret,id=ARTIFACT_USER \ && chown -R nobody var \ && chmod -R 700 public \ && chmod -R 700 var \ - && rm artifact.zip - -RUN rm -r var/cache \ - && rm -rf /var/cache/apk/* + && rm artifact.zip \ + && rm -r var/cache USER nobody