Add postman collection for UI HTPP server
[e-mobility-charging-stations-simulator.git] / docker / Dockerfile
... / ...
CommitLineData
1FROM node:lts-alpine as builder
2
3RUN apk add --no-cache --virtual .gyp \
4 build-base \
5 python3
6
7# Build simulator
8WORKDIR /usr/builder
9COPY package.json package-lock.json tsconfig.json rollup.config.mjs prepare.js build-requirements.js ./
10COPY src ./src
11COPY docker/config.json ./src/assets/config.json
12COPY docker/authorization-tags.json ./src/assets/authorization-tags.json
13RUN npm set progress=false && npm config set depth 0 && npm cache clean --force && npm install
14RUN npm run build
15
16# Build simulator dashboard
17WORKDIR /usr/builder/webui
18COPY src/ui/web ./
19RUN npm set progress=false && npm config set depth 0 && npm cache clean --force && npm install
20RUN npm run build
21
22RUN apk del .gyp
23
24FROM node:lts-alpine
25
26ARG STACK_TRACE_LIMIT
27ARG MAX_OLD_SPACE_SIZE
28
29ENV NODE_OPTIONS="--stack-trace-limit=${STACK_TRACE_LIMIT} --max-old-space-size=${MAX_OLD_SPACE_SIZE}"
30
31WORKDIR /usr/app
32COPY --from=builder /usr/builder/webui ./webui
33COPY --from=builder /usr/builder/node_modules ./node_modules
34COPY --from=builder /usr/builder/dist ./dist
35COPY README.md LICENSE ./
36COPY docker/start.sh /start.sh
37COPY docker/autoconfig.sh /autoconfig.sh
38RUN chmod +x /start.sh
39RUN chmod +x /autoconfig.sh
40
41CMD /autoconfig.sh && /start.sh