-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
42 lines (37 loc) · 859 Bytes
/
Dockerfile
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
31
32
33
34
35
36
37
38
39
40
41
42
FROM node:20.12.2-alpine3.18 as base
# All deps stage
FROM base as deps
WORKDIR /app
ADD package.json package-lock.json ./
RUN npm ci
# Production only deps stage
FROM base as production-deps
WORKDIR /app
ADD package.json package-lock.json .env ./
RUN npm ci --omit=dev
# Install pino-pretty
RUN npm install pino-pretty
# Build stage
FROM base as build
WORKDIR /app
COPY --from=deps /app/node_modules /app/node_modules
ADD . .
RUN node ace build
# Production stage
FROM base
ARG PORT
ENV TZ=UTC
ENV HOST=0.0.0.0
ENV LOG_LEVEL=info
ENV APP_KEY=KsSHcSwIiCsxg2jQvoF7DPsnqzpnfiVd
ENV NODE_ENV=production
ENV DB_HOST=127.0.0.1
ENV DB_PORT=5432
ENV DB_USER=postgres
ENV DB_DATABASE=pipeops
ENV PORT $PORT
WORKDIR /app
COPY --from=production-deps /app/node_modules /app/node_modules
COPY --from=build /app/build /app
EXPOSE 8080
CMD ["node", "./bin/server.js"]