Socialify

Folder ..

Viewing Dockerfile.distroless
29 lines (20 loc) • 648.0 B

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM node:20 as builder

LABEL version="1.0.0"
LABEL description="Consumet API (fastify) Docker Image"

WORKDIR /app

# set default node env
ENV NODE_ENV=production
ENV NPM_CONFIG_LOGLEVEL=warn
ENV PORT=3000

# copy project definition/dependencies files, for better reuse of layers
COPY package*.json ./

# install dependencies here, for better reuse of layers
RUN npm install && npm audit fix

# copy all sources in the container (exclusions in .dockerignore file)
COPY . .


# release layer (the only one in the final image)
FROM gcr.io/distroless/nodejs:18 AS release
COPY --from=builder /app /app
WORKDIR /app

EXPOSE 3000

CMD [ "./src/main" ]