forked from strimzi/strimzi-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
34 lines (24 loc) · 1.1 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
#
# Copyright Strimzi authors.
# License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
#
# Note: this is provided for purposes of completing/illustrating a production build of the UI - this will be replaced in due course with a strimzi based image + node runtime w/ tini etc
FROM node:lts-alpine as builder
WORKDIR /usr/strimzi-ui/
COPY --chown=root:root / /usr/strimzi-ui/
# install all deps, and build client/server
RUN npm install -q \
&& npm run build
# clear deps, and only install prod deps - needed as server build does not bundle them/node provided functions
RUN rm -rf /node_modules \
&& npm install -q --only=production \
&& npm dedupe
# ---------------------------------------------------------------------------- #
FROM node:lts-alpine
# copy required built output to image
COPY --from=builder --chown=root:root /usr/strimzi-ui/LICENSE ./
COPY --from=builder --chown=root:root /usr/strimzi-ui/dist ./dist
COPY --from=builder --chown=root:root /usr/strimzi-ui/node_modules ./node_modules
USER node
EXPOSE 3000
ENTRYPOINT [ "node" , "/dist/server/main.js" ]