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"]