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 permission on upload folder in docker #173

Open
DeAlexPesh opened this issue Aug 2, 2023 · 2 comments
Open

Fix permission on upload folder in docker #173

DeAlexPesh opened this issue Aug 2, 2023 · 2 comments

Comments

@DeAlexPesh
Copy link

Dockerfile

FROM node:16.13-alpine3.13 AS base
RUN apk add --no-cache git \
 && git clone https://github.com/timvisee/send.git /home/send \
 && mv -f /home/send /app
WORKDIR /app

FROM base AS build
RUN PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm ci \
 && npm run build

FROM node:16.13-alpine3.13 AS prod
RUN set -x \
 && apk --no-cache add shadow \
 && groupmod -g 1001 node \
 && usermod -u 1001 -g 1001 node \
 && set -x \
 && addgroup --gid 1000 app \
 && adduser --disabled-password --gecos '' --ingroup app --home /app --uid 1000 app \
 && mkdir -p /uploads \
 && chown app:app -R /uploads
USER app
WORKDIR /app
COPY --chown=app:app --from=base /app/package*.json ./
COPY --chown=app:app --from=base /app/app app
COPY --chown=app:app --from=base /app/common common
COPY --chown=app:app --from=base /app/public/locales public/locales
COPY --chown=app:app --from=base /app/server server
COPY --chown=app:app --from=build /app/dist dist
RUN npm ci --production \
 && npm cache clean --force \
 && mkdir -p /app/.config/configstore \
 && ln -s dist/version.json version.json
VOLUME /uploads
ENV PORT=1443
EXPOSE ${PORT}
CMD ["node", "server/bin/prod.js"]

docker-compose

version: "3"
...
  volumes:
   - "uploads:/uploads"
...
volumes:
 uploads:
  driver: local
  driver_opts:
   o: bind
   type: none
   device: /folder_of_uploads
@DeAlexPesh
Copy link
Author

Your new repository is not much different from this, except that the node version has changed to node:20-alpine3.17, but:

1.683 npm WARN EBADENGINE Unsupported engine {
1.684 npm WARN EBADENGINE   package: '[email protected]',
1.684 npm WARN EBADENGINE   required: { node: '^16.13.0' },
1.684 npm WARN EBADENGINE   current: { node: 'v20.5.0', npm: '9.8.0' }
1.684 npm WARN EBADENGINE }

and

29.64 /app/node_modules/webpack-cli/bin/cli.js:93
29.64                           throw err;
29.64                           ^
29.64
29.64 Error: Cannot find module './test/frontend/index.js'

and chmod 777 - this is not a solution, for this they beat on the hands.

@DeAlexPesh
Copy link
Author

Fixed!

nope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant