From e1b3db6c8266bdfe61115f15985545476296639b Mon Sep 17 00:00:00 2001 From: dcshzj <27919917+dcshzj@users.noreply.github.com> Date: Thu, 29 Feb 2024 14:22:02 +0800 Subject: [PATCH] fix(docker): ensure gitconfig is stored in the right place --- Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index bda072048..8ccca8b30 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,9 +27,6 @@ RUN npm ci RUN rm -rf /var/cache/apk/* RUN git config --system --add safe.directory '*' -RUN echo "[user]" > /root/.gitconfig -RUN echo " name = Isomer Admin" >> /root/.gitconfig -RUN echo " email = admin@isomer.gov.sg" >> /root/.gitconfig RUN chmod +x ./scripts/02_fetch_ssh_keys.sh @@ -38,5 +35,10 @@ RUN chown -R webapp:webapp /home/webapp/.ssh # NOTE: We need to run the app as webapp, otherwise we will encounter # permissions issues on EFS, and all files will be erroneously owned by root. USER webapp + +RUN echo "[user]" > /home/webapp/.gitconfig +RUN echo " name = Isomer Admin" >> /home/webapp/.gitconfig +RUN echo " email = admin@isomer.gov.sg" >> /home/webapp/.gitconfig + EXPOSE "8081" CMD ["bash", "-c", "bash ./scripts/02_fetch_ssh_keys.sh & npm run start:ecs:$NODE_ENV"]