-
Notifications
You must be signed in to change notification settings - Fork 508
/
Dockerfile
74 lines (55 loc) · 2.26 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
#
# conductor:server - Build Conductor Server
#
# ===========================================================================================================
# 0. Builder stage 1
# ===========================================================================================================
FROM openjdk:17-bullseye AS builder
LABEL maintainer="Orkes OSS <[email protected]>"
# Copy the project directly onto the image
COPY . /conductor
WORKDIR /conductor
# Build the server on run
RUN ./gradlew build -x test
WORKDIR /server/build/libs
RUN ls -ltr
#
# conductor:server - Build Conductor UI
#
# ===========================================================================================================
# 1. Builder stage 2
# ===========================================================================================================
FROM alpine:3.20 AS ui-builder
LABEL maintainer="Orkes OSS <[email protected]>"
# Install dependencies
RUN apk add --update nodejs npm yarn
COPY . /conductor
WORKDIR /conductor/ui
# Include monaco sources into bundle (instead of using CDN)
ENV REACT_APP_MONACO_EDITOR_USING_CDN=false
RUN yarn install && cp -r node_modules/monaco-editor public/ && yarn build
RUN ls -ltr
RUN echo "Done building UI"
# ===========================================================================================================
# 2. Bin stage
# ===========================================================================================================
FROM alpine:3.19
LABEL maintainer="Orkes OSS <[email protected]>"
RUN apk add openjdk17
RUN apk add nginx
# Make app folders
RUN mkdir -p /app/config /app/logs /app/libs
# Copy the compiled output to new image
COPY docker/server/bin /app
COPY docker/server/config /app/config
COPY --from=builder /conductor/server/build/libs/*boot*.jar /app/libs/conductor-server.jar
# Copy compiled UI assets to nginx www directory
WORKDIR /usr/share/nginx/html
RUN rm -rf ./*
COPY --from=ui-builder /conductor/ui/build .
COPY --from=ui-builder /conductor/docker/server/nginx/nginx.conf /etc/nginx/http.d/default.conf
# Copy the files for the server into the app folders
RUN chmod +x /app/startup.sh
HEALTHCHECK --interval=60s --timeout=30s --retries=10 CMD curl -I -XGET http://localhost:8080/health || exit 1
CMD [ "/app/startup.sh" ]
ENTRYPOINT [ "/bin/sh"]