mirror of
https://github.com/lovasoa/whitebophir
synced 2024-11-10 06:24:17 +00:00
Fix dockerfile permission error
Allow node to bind to port 80 as non-root
This commit is contained in:
parent
ea8aeb1c48
commit
7294746cad
1 changed files with 5 additions and 2 deletions
|
@ -1,10 +1,13 @@
|
|||
FROM node:16-alpine
|
||||
|
||||
|
||||
WORKDIR /opt/app
|
||||
|
||||
RUN chown -R 1000:1000 /opt/app
|
||||
|
||||
# Allow node to bind to port 80
|
||||
RUN apk update && apk add libcap
|
||||
RUN setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/node
|
||||
|
||||
USER 1000:1000
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
|
@ -16,4 +19,4 @@ EXPOSE 80
|
|||
|
||||
VOLUME /opt/app/server-data
|
||||
|
||||
CMD ["npm", "start"]
|
||||
CMD ["/usr/local/bin/node", "server/server.js"]
|
||||
|
|
Loading…
Reference in a new issue