Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dockerfile.liquid): fixed the wrong order #78

Merged
merged 1 commit into from
May 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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