FROM node:14.2.0-alpine3.10
EXPOSE 3000
RUN apk add --update tini
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json package.json
RUN npm install
COPY . .
CMD ["tini", "--", "node", "./bin/www"]
cd into the directory that contains the above as Dockerfile, and run
docker build -t testnode
The above will be built as an image and tagged with testnode. After we make sure testnode can be run properly (by running docker container run --rm -p 80:3000 testnode), we change the tag name as follows:
docker tag testnode machingclee/testnode
and then
docker push machingclee/testnode
if we want.
No comments:
Post a Comment