Files
hasura-backend-plus/Dockerfile
Pilou c574f9d817 Multistage docker (#292)
* fix: don't copy any pem file to Docker

* perf: split typescript dependencies to devDependencies

* perf: multi-stage production docker
2020-07-01 12:04:04 +02:00

28 lines
570 B
Docker

FROM node:14-alpine AS builder
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install
COPY . .
RUN yarn build
FROM node:14-alpine
ARG NODE_ENV=production
ENV NODE_ENV $NODE_ENV
ENV PORT 3000
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install && yarn cache clean
COPY --from=builder /app/dist/ dist/
COPY custom custom
COPY metadata metadata
COPY migrations migrations
COPY migrations-v1 migrations-v1
HEALTHCHECK --interval=60s --timeout=2s --retries=3 CMD wget localhost:${PORT}/healthz -q -O - > /dev/null 2>&1
EXPOSE $PORT
CMD ["yarn", "start"]