forked from StaelensRobin/rest-on-mongo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
20 lines (14 loc) · 830 Bytes
/
Dockerfile
File metadata and controls
20 lines (14 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Following https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md
# Use the latest LTS node based on alpine linux distro
FROM node:12-alpine
# Create global installs in .npm-global in the default home directory
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH=$PATH:/home/node/.npm-global/bin
# No working directory needed, as we don't use this at all. We directly
# install from npm to ensure that we create dockers only of released versions.
# Install the latest version of rest-on-mongo. There is little use for anything else.
# Also, clean the npm cache to get rid of unwanted files within the image.
RUN npm install -g rest-on-mongo@2.4.0 && npm cache --force clean
ENTRYPOINT ["rest-on-mongo"]
# This makes the process run as a non-root user (node user is builtin in the node docker)
USER node