fix docker file permissions so 777 is no longer needed

This commit is contained in:
dousha 2022-05-21 13:25:59 +08:00
parent 2085dc5ed4
commit 942f17b2f4
2 changed files with 12 additions and 2 deletions

View File

@ -18,13 +18,19 @@ RUN set -x \
nasm \
libpng-dev \
python3 \
wget \
&& npm install --production \
&& apk del .build-dependencies
# Some setup tools need to be kept
RUN apk add --no-cache su-exec
# Bundle app source
COPY . .
USER node
# Add application user and setup proper volume permissions
RUN adduser -s /bin/false node; exit 0
# Start the application
EXPOSE 8080
CMD [ "node", "./src/www" ]
CMD [ "./start-docker.sh" ]

4
start-docker.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
chown -R node:node /home/node
su-exec node node ./src/www