mirror of
https://github.com/kubevela/kubevela.git
synced 2026-05-16 14:27:00 +00:00
46 lines
1010 B
Docker
46 lines
1010 B
Docker
# FROM node:12
|
|
|
|
# # See: https://nodejs.org/en/docs/guides/nodejs-docker-webapp/
|
|
|
|
# # Create app directory
|
|
# WORKDIR /usr/src/app
|
|
|
|
# # Install app dependencies
|
|
# # A wildcard is used to ensure both package.json AND package-lock.json are copied
|
|
# # where available (npm@5+)
|
|
# COPY package*.json ./
|
|
|
|
# RUN npm install
|
|
# # If you are building your code for production
|
|
# # RUN npm ci --only=production
|
|
|
|
# # Bundle app source
|
|
# COPY . .
|
|
|
|
# EXPOSE 8080
|
|
# CMD [ "node", "server.js" ]
|
|
|
|
# ------
|
|
|
|
FROM mhart/alpine-node:12
|
|
WORKDIR /app
|
|
COPY package.json ./
|
|
|
|
# If you have native dependencies, you'll need extra tools
|
|
# RUN apk add --no-cache make gcc g++ python
|
|
RUN npm install
|
|
RUN npm ci --prod
|
|
|
|
# Then we copy over the modules from above onto a `slim` image
|
|
FROM mhart/alpine-node:slim-12
|
|
|
|
# If possible, run your container using `docker run --init`
|
|
# Otherwise, you can use `tini`:
|
|
# RUN apk add --no-cache tini
|
|
# ENTRYPOINT ["/sbin/tini", "--"]
|
|
|
|
WORKDIR /app
|
|
COPY --from=0 /app .
|
|
COPY . .
|
|
CMD ["node", "server.js"]
|