0.0.3 • Published 7 years ago
@zeit/init v0.0.3
init
init inspects the specified directory and generates a suggested Dockerile
based on various hueristics used to detect the project type.
mkdir my-awesome-app
cd my-awesome-app
touch server.js
now initGenerates something like:
FROM mhart/alpine-node:8 as base
WORKDIR /usr/src
COPY package.json yarn.lock /usr/src/
RUN yarn --production
COPY . .
FROM alpine:3.8
COPY --from=base /usr/bin/node /usr/bin/
WORKDIR /usr/src
ENV PATH="./node_modules/.bin:$PATH"
ENV NODE_ENV="production"
COPY --from=base /usr/src .
CMD micro server.jsNode.js support features:
- Includes apkpackages for known native dependencies
- Maps "engines"field to the proper Alpine base image
- Maps the "scripts.build"command to run during the build phase
- Maps the "scripts.start"command to theCMDof the Dockerfile
- Uses yarnornpmdepending on the existence ofyarn.lockandpackage-lock.json