From ae8132f0dbf28a868d96663afd7ca008bda701de Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Fri, 10 Mar 2023 23:11:23 +0000 Subject: [PATCH] feat: add `root_commands` As well as commands that are run by the `app` user, also specify commands that should be run by the `root` user such as updating the `DocumentRoot` within an Apache virtual host. --- templates/Dockerfile.twig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/Dockerfile.twig b/templates/Dockerfile.twig index fc81755..07ee4ff 100644 --- a/templates/Dockerfile.twig +++ b/templates/Dockerfile.twig @@ -45,6 +45,10 @@ COPY --chown=app:app {{ dockerfile.stages.build.extra_files | join(" ") }} ./ COPY --chown=app:app {{ directory }} {{ directory }} {% endfor %} +{% for command in dockerfile.stages.build.root_commands | default([]) %} +RUN {{ command | raw }} +{% endfor %} + USER app {% for command in dockerfile.stages.build.commands %}