-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
46 lines (30 loc) · 974 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
43
44
45
46
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# ---------- Base ----------
FROM node:14-alpine AS base
WORKDIR /app
# ---------- Builder ----------
# Creates:
# - node_modules: production dependencies (no dev dependencies)
# - dist: A production build compiled with typescript
FROM base AS builder
COPY package*.json tsconfig.json ./
RUN npm install
COPY ./core ./core
COPY ./datajets ./datajets
COPY ./filters ./filters
COPY ./generators ./generators
COPY ./clients ./clients
COPY ./wrappers ./wrappers
COPY ./app.ts ./app.ts
RUN npm run build
RUN npm prune --production # Remove dev dependencies
# ---------- Release ----------
FROM base AS release
COPY ./data/data-public ./data/data-public
COPY ./firelens-datajet.json ./firelens-datajet.json
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY package.json ./
USER node
CMD ["node", "./dist/app.js"]