Skip to content

Instantly share code, notes, and snippets.

@romch007
Created February 26, 2021 10:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save romch007/2ecdb73140d4af9d157369babc4280b8 to your computer and use it in GitHub Desktop.
Save romch007/2ecdb73140d4af9d157369babc4280b8 to your computer and use it in GitHub Desktop.
AdonisJS v5 Dockerfile
FROM node:lts-alpine AS builder
WORKDIR /builder
COPY package.json yarn.lock ./
RUN apk update && apk add git
RUN yarn install --frozen-lockfile
COPY . .
RUN node ace build --prod --client yarn
FROM node:lts-alpine
ENV NODE_ENV=production
ENV PORT=80
ENV HOST=0.0.0.0
WORKDIR /app
RUN apk update && apk add git
COPY --from=builder /builder/build/package.json /builder/build/yarn.lock ./
RUN yarn install --production --frozen-lockfile
COPY --from=builder /builder/build /app
CMD ["node", "server.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment