Skip to content

Commit

Permalink
Merge pull request #78 from strapi-community/bugfix/#77-docker-file-w…
Browse files Browse the repository at this point in the history
…rong-order

fix(dockerfile.liquid): fixed the wrong order
  • Loading branch information
Eventyret committed May 25, 2023
2 parents f957839 + 98c0261 commit 9ba7246
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions templates/Dockerfile.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand All @@ -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"]
Expand Down

0 comments on commit 9ba7246

Please sign in to comment.