From 98c0261163d10d435cee41056ab80e416f44dcac Mon Sep 17 00:00:00 2001 From: Simen Daehlin Date: Thu, 25 May 2023 12:04:11 +0100 Subject: [PATCH] fix(dockerfile.liquid): fixed the wrong order which would cause EACCESS error Fixed an issue reported #77 Fix #77 --- templates/Dockerfile.liquid | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/templates/Dockerfile.liquid b/templates/Dockerfile.liquid index 69406ee..7a438ac 100644 --- a/templates/Dockerfile.liquid +++ b/templates/Dockerfile.liquid @@ -5,14 +5,8 @@ ARG NODE_ENV=development ENV NODE_ENV=${NODE_ENV} RUN addgroup -g 1001 strapi && adduser -u 1001 -G strapi -s /bin/sh -D strapi -WORKDIR /opt/{%- if packageManager == "yarn" %} -COPY package.json yarn.lock ./ -{%- else %} -COPY package.json package-lock.json ./ -{% endif %} -ENV PATH /opt/node_modules/.bin:$PATH -RUN chown -R strapi:strapi /opt/ -USER strapi{%- if packageManager == "yarn" %} +WORKDIR /opt/ +{%- if packageManager == "yarn" %} COPY package.json yarn.lock ./ RUN yarn config set network-timeout 600000 -g && yarn install {%- else %} @@ -21,6 +15,9 @@ RUN npm config set network-timeout 600000 -g && npm install {%- endif %} WORKDIR /opt/app +ENV PATH /opt/node_modules/.bin:$PATH +RUN chown -R strapi:strapi /opt/app +USER strapi COPY . . {%- if packageManager == "yarn" %} RUN ["yarn", "build"]