Commit 5fa006c7 authored by GanJc's avatar GanJc

dockerfile

parent 440af7bd
FROM node
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
#RUN npm install
COPY . /usr/src/app
EXPOSE 3000
CMD [ "npm", "start" ]
\ No newline at end of file
# Dockerfile.alpine
FROM alpine:edge
# Install node.js by apk
RUN echo '@edge http://nl.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories
RUN apk update && apk upgrade
RUN apk add --no-cache nodejs-lts@edge
# If you have native dependencies, you'll need extra tools
# RUN apk add --no-cache make gcc g++ python
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# If your project depends on many package, you can use cnpm instead of npm
# RUN npm install cnpm -g --registry=https://registry.npm.taobao.org
# RUN cnpm install
# Install app dependencies
COPY package.json /usr/src/app/
RUN npm install
# Bundle app source
COPY . /usr/src/app
# Expose port
EXPOSE 3000
CMD [ "npm", "start" ]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment