-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
24 lines (23 loc) · 840 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
# Build stage: compile Typescript to Javascript
FROM node:12-alpine AS builder
WORKDIR /app
COPY . .
RUN npm ci
RUN npm run build
# obfuscate compiled Javascript (optional)
# RUN npm install -g javascript-obfuscator
# RUN javascript-obfuscator ./dist --output ./obfuscated --split-strings true --split-strings-chunk-length 3
# Final stage: copy compiled Javascript from previous stage and install production dependencies
FROM node:12-alpine
ENV NODE_ENV=production
# Uncomment the following line to enable agent logging
LABEL "network.forta.settings.agent-logs.enable"="true"
WORKDIR /app
# if using obfuscated code:
# COPY --from=builder /app/obfuscated ./src
# else if using unobfuscated code:
COPY --from=builder /app/dist ./src
COPY package*.json ./
COPY agent-config.json ./
RUN npm ci --production
CMD [ "npm", "run", "start:prod" ]