-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.api
41 lines (30 loc) · 1.2 KB
/
Dockerfile.api
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
FROM node:18-alpine AS builder
WORKDIR /usr/local/apps/stela/
COPY package.json ./
COPY tsconfig.build.json ./
COPY tsconfig.json ./
COPY jest.config.js ./
COPY packages ./packages
RUN npm install -g [email protected]
RUN npm install
RUN npm install -ws
RUN npm run build -ws
FROM node:18-alpine AS final
ARG AWS_RDS_CERT_BUNDLE
WORKDIR /usr/local/apps/stela/
ENV NEW_RELIC_NO_CONFIG_FILE=true
ENV NEW_RELIC_DISTRIBUTED_TRACING_ENABLED=true
ENV NEW_RELIC_LOG=stdout
RUN mkdir /etc/ca-certificates
RUN echo -e $AWS_RDS_CERT_BUNDLE > /etc/ca-certificates/rds-us-west-2-ca-bundle.pem
COPY --from=builder /usr/local/apps/stela/packages/api/dist ./packages/api/dist
COPY --from=builder /usr/local/apps/stela/packages/api/package.json ./packages/api/package.json
COPY --from=builder /usr/local/apps/stela/packages/logger/dist ./packages/logger/dist
COPY --from=builder /usr/local/apps/stela/packages/logger/package.json ./packages/logger/package.json
COPY --from=builder /usr/local/apps/stela/package.json ./package.json
COPY --from=builder /usr/local/apps/stela/package-lock.json ./package-lock.json
RUN npm install -g [email protected]
RUN npm install --workspace @stela/api
ENV PORT=80
EXPOSE 80
CMD node packages/api/dist/index.js