Skip to content

Commit

Permalink
Move alpine build to Dockerfile.alpine; add tini to debian Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
brtwrst authored and jlongster committed May 3, 2022
1 parent c4badb9 commit 6be206f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
17 changes: 7 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
FROM alpine as base

RUN apk add --no-cache nodejs yarn openssl tini
RUN mkdir /app
FROM node:16-bullseye as base
RUN apt-get update && apt-get install -y openssl
WORKDIR /app
ENV NODE_ENV=production
ADD yarn.lock package.json ./
RUN npm rebuild bcrypt --build-from-source
RUN yarn install --production

FROM alpine as prod

RUN apk add --no-cache nodejs yarn openssl tini
FROM node:16-bullseye-slim as prod
RUN apt-get update && apt-get install openssl tini && apt-get clean -y && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=base /app /app
ADD . .

ENTRYPOINT ["/sbin/tini", "--"]
CMD ["yarn", "start"]
ENTRYPOINT ["/usr/bin/tini","-g", "--"]
CMD ["node", "app.js"]
15 changes: 15 additions & 0 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM alpine as base
RUN apk add --no-cache nodejs yarn npm python3 openssl build-base
WORKDIR /app
ENV NODE_ENV=production
ADD yarn.lock package.json ./
RUN npm rebuild bcrypt --build-from-source
RUN yarn install --production

FROM alpine as prod
RUN apk add --no-cache nodejs yarn openssl tini
WORKDIR /app
COPY --from=base /app /app
ADD . .
ENTRYPOINT ["/sbin/tini","-g", "--"]
CMD ["node", "app.js"]

0 comments on commit 6be206f

Please sign in to comment.