-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdockerfile
77 lines (56 loc) · 1.81 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.8.4 as watchdog
FROM --platform=${TARGETPLATFORM:-linux/amd64} node:14-alpine as ship
ARG TARGETPLATFORM
ARG BUILDPLATFORM
COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog
RUN addgroup -S app && adduser -S -g app app
RUN apk --no-cache add curl ca-certificates
# Turn down the verbosity to default level.
ENV NPM_CONFIG_LOGLEVEL warn
# Create a folder named function
RUN mkdir -p /home/app
# Wrapper/boot-strapper
WORKDIR /home/app
COPY ./package.json ./
COPY ./package-lock.json ./
COPY ./tsconfig.json ./
COPY ./global.d.ts ./
# Install dependencies
RUN npm install
COPY ./src ./src
# Build the project
RUN npm run build
# Environment variables for openfaas
ENV cgi_headers="true"
ENV fprocess="node ./build/index.js"
ENV mode="http"
ENV upstream_url="http://127.0.0.1:3000"
ENV exec_timeout="10s"
ENV write_timeout="15s"
ENV read_timeout="15s"
ENV prefix_logs="false"
ENV FUNCTION_NAME=typology-processor-rel-1-0-0
ENV NODE_ENV=production
ENV PORT=3000
ENV CADP_ENDPOINT=http://gateway.openfaas:8080/function/off-channel-aggregation-decisioning-processor-rel-1-0-0.openfaas-fn/execute
ENV CMS_ENDPOINT=http://gateway.openfaas:8080/function/off-cms-service.openfaas-fn/execute
ENV CACHE_TTL=0
ENV REDIS_DB=0
ENV REDIS_AUTH=
ENV REDIS_HOST=
ENV REDIS_PORT=6379
ENV DATABASE_NAME=Configuration
ENV DATABASE_URL=http://arango.development:8529
ENV DATABASE_USER=root
ENV DATABASE_PASSWORD=''
ENV COLLECTION_NAME=typologyExpression
ENV APM_ACTIVE=true
ENV APM_SERVICE_NAME=typology-processor
ENV APM_URL=http://apm-server.development:8200
ENV APM_SECRET_TOKEN=
ENV LOGSTASH_HOST=logstash.development
ENV LOGSTASH_PORT=8080
HEALTHCHECK --interval=60s CMD [ -e /tmp/.lock ] || exit 1
# Execute watchdog command
CMD ["fwatchdog"]