Skip to content

Commit

Permalink
fix(dockerfile.liquid): fixed wrong user for permission denied of upl…
Browse files Browse the repository at this point in the history
…oads
  • Loading branch information
Eventyret committed May 26, 2023
1 parent 61c6a76 commit 4e62acb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions templates/Dockerfile-prod.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ RUN npm run build

# Creating final production image
FROM node:16-alpine
RUN addgroup -g 1001 strapi && adduser -u 1001 -G strapi -s /bin/sh -D strapi
RUN apk add --no-cache vips-dev
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
Expand All @@ -33,8 +32,8 @@ WORKDIR /opt/app
COPY --from=build /opt/app ./
ENV PATH /opt/node_modules/.bin:$PATH

RUN chown -R strapi:strapi /opt/app
USER strapi
RUN chown -R node:node /opt/app
USER node
EXPOSE 1337
{%- if packageManager == "yarn" %}
CMD ["yarn", "start"]
Expand Down
5 changes: 2 additions & 3 deletions templates/Dockerfile.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ FROM node:16-alpine
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev nasm bash vips-dev
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" %}
Expand All @@ -17,8 +16,8 @@ RUN npm config set network-timeout 600000 -g && npm install
WORKDIR /opt/app
COPY . .
ENV PATH /opt/node_modules/.bin:$PATH
RUN chown -R strapi:strapi /opt/app
USER strapi
RUN chown -R node:node /opt/app
USER node
{%- if packageManager == "yarn" %}
RUN ["yarn", "build"]
{%- else %}
Expand Down

0 comments on commit 4e62acb

Please sign in to comment.