为 Meteor 应用构建 Docker 镜像

Dockerfile

FROM ubuntu

RUN apt-get update

RUN apt-get install -y curl

RUN curl https://install.meteor.com/ | sh

WORKDIR /src

COPY package.json /src

COPY .meteor/ /src/.meteor

ENV NODE_ENV=production

RUN meteor npm install --production

COPY . /src

RUN meteor build --directory /build --allow-superuser

FROM node:8-alpine

WORKDIR /app

COPY --from=0 /build/bundle /app

ENV NODE_ENV=production

RUN cd programs/server && npm install --production

ENV PORT=80

CMD ["node", "main.js"]

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容