Skip to content

Commit

Permalink
feat: Use node 18 alpine (#312)
Browse files Browse the repository at this point in the history
* feat: Use node 18 alpine

* fix: Add new line
  • Loading branch information
LautaroPetaccio authored Jun 27, 2023
1 parent 5437212 commit 2c68326
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
26 changes: 19 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ARG RUN

FROM node:16 as builder
FROM node:18-alpine as builderenv

WORKDIR /app

# some packages require a build step
RUN apt-get update
RUN apt-get -y -qq install python-setuptools python-dev build-essential
RUN apk update
RUN apk add --no-cache py3-setuptools python3-dev build-base

# install dependencies
COPY package.json /app/package.json
Expand All @@ -21,8 +21,20 @@ RUN npm run test
# remove devDependencies, keep only used dependencies
RUN npm ci --only=production

# build the release app
FROM node:16
FROM node:18-alpine

RUN apk update
RUN apk add --no-cache tini

# NODE_ENV is used to configure some runtime options, like JSON logger
ENV NODE_ENV production

WORKDIR /app
COPY --from=builder /app /app
ENTRYPOINT [ "./entrypoint.sh" ]
COPY --from=builderenv /app /app
# Please _DO NOT_ use a custom ENTRYPOINT because it may prevent signals
# (i.e. SIGTERM) to reach the service
# Read more here: https://aws.amazon.com/blogs/containers/graceful-shutdowns-with-ecs/
# and: https://www.ctl.io/developers/blog/post/gracefully-stopping-docker-containers/
ENTRYPOINT ["/sbin/tini", "--"]
# Run the program under Tini
CMD [ "/usr/local/bin/node", "--trace-warnings", "--abort-on-uncaught-exception", "--unhandled-rejections=strict", "dist/index.js" ]
3 changes: 0 additions & 3 deletions entrypoint.sh

This file was deleted.

0 comments on commit 2c68326

Please sign in to comment.