You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FROM node:carbon-alpine
#after this you can just use ./ to refer to cwdWORKDIR /parse-server
#Specify multiple volumes in one line - reuse layers during buildVOLUME ["/parse-server/config", "/parse-server/cloud"]
#Copy into /parse-server which is current working directoryCOPY ./ ./
RUN npm install && \
npm run build
ENV PORT=1337
EXPOSE $PORT
# non-root userUSER node
# start with node, not npmENTRYPOINT ["node", "./bin/parse-server", "--"]
Is your feature request related to a problem? Please describe.
Use node:carbon-alpine base image to reduce image size (unless you you really need the full size node image)
Volumes:
No need to mkdir + VOLUME. Also, it is possible to specify multi in one line
https://docs.docker.com/engine/reference/builder/#volume
Non-root user:
https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#non-root-user
Entrypoint - use node and not npm
https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#docker-run
Multi stage Dockerfile - reduce image size by building final image without devDependencies:
Docker multi stage - https://docs.docker.com/develop/develop-images/multistage-build/
TravisCI supported - Upgrade Docker for multi-stage build support travis-ci/travis-ci#8181
Suggestted Dockerfile