Skip to content

Commit

Permalink
update docker builds (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1r3n authored Sep 29, 2023
1 parent 9ae6d10 commit efe0573
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 9 deletions.
35 changes: 33 additions & 2 deletions docker/DockerfileServer
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
#
# conductor:server - Combined Netflix conductor server & UI
#
# ===========================================================================================================
# 0. Builder stage
# ===========================================================================================================
FROM alpine:3.18 AS builder

MAINTAINER Orkes Inc <[email protected]>

# ===========================================================================================================
# 0. Build Conductor Server UI
# ===========================================================================================================


# Install dependencies
RUN apk add openjdk17
RUN apk add git
RUN apk add --update nodejs npm yarn

COPY . /conductor-community
WORKDIR conductor-community
RUN ./gradlew clean build -x test

WORKDIR /
RUN git clone https://github.com/Netflix/conductor
WORKDIR conductor/ui
RUN yarn install && yarn build
RUN ls -ltr
RUN echo "Done building UI"

FROM alpine:3.18.3

MAINTAINER Orkes Inc <[email protected]>
Expand All @@ -16,7 +47,7 @@ RUN mkdir -p /app/config /app/logs /app/libs /app/info
# Make sure to run build-ui.sh script before running the docker build to pull and build the UI
WORKDIR /usr/share/nginx/html
RUN rm -rf ./*
COPY docker/tmp/ui/conductor/ui/build .
COPY --from=builder /conductor/ui/build .
COPY docker/config/nginx.conf /etc/nginx/http.d/default.conf

# Startup script(s)
Expand All @@ -25,7 +56,7 @@ COPY docker/config/config.properties /app/config/config.properties
COPY server/src/main/resources/banner.txt /app/config/banner.txt

# JAR files
COPY server/build/libs/orkes-conductor-server-boot.jar /app/libs/server.jar
COPY --from=builder conductor-community/server/build/libs/orkes-conductor-server-boot.jar /app/libs/server.jar

# Server version
#COPY assembled/libs/server-version.txt* /app/info
Expand Down
36 changes: 33 additions & 3 deletions docker/DockerfileStandalone
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
#
# conductor:server - Combined Netflix conductor server & UI
#
# ===========================================================================================================
# 0. Builder stage
# ===========================================================================================================
FROM alpine:3.18 AS builder

MAINTAINER Orkes Inc <[email protected]>

# ===========================================================================================================
# 0. Build Conductor Server UI
# ===========================================================================================================


# Install dependencies
RUN apk add openjdk17
RUN apk add git
RUN apk add --update nodejs npm yarn

COPY . /conductor-community
WORKDIR conductor-community
RUN ./gradlew clean build -x test

WORKDIR /
RUN git clone https://github.com/Netflix/conductor
WORKDIR conductor/ui
RUN yarn install && yarn build
RUN ls -ltr
RUN echo "Done building UI"

FROM alpine:3.18.3
MAINTAINER Orkes Inc <[email protected]>

Expand All @@ -15,10 +46,9 @@ RUN mkdir -p /app/config /app/logs /app/libs /app/info
# Make sure to run build-ui.sh script before running the docker build to pull and build the UI
WORKDIR /usr/share/nginx/html
RUN rm -rf ./*
COPY docker/tmp/ui/conductor/ui/build .
COPY --from=builder /conductor/ui/build .
COPY docker/config/nginx.conf /etc/nginx/http.d/default.conf


# Startup script(s)
COPY docker/config/startup.sh /app/startup.sh
COPY docker/config/config.properties /app/config/config.properties
Expand All @@ -27,7 +57,7 @@ COPY docker/config/start_all.sh /app/start_all.sh
COPY server/src/main/resources/banner.txt /app/config/banner.txt

# JAR files
COPY server/build/libs/orkes-conductor-server-boot.jar /app/libs/server.jar
COPY --from=builder conductor-community/server/build/libs/orkes-conductor-server-boot.jar /app/libs/server.jar

RUN chmod +x /app/startup.sh
RUN touch /app/logs/server.log
Expand Down
13 changes: 9 additions & 4 deletions run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
./gradlew clean build
# Create an empty ui build directory... we don't need UI for this build
mkdir -p docker/tmp/ui/conductor/ui/build
docker rm -f conductor_test_container
docker build -f docker/DockerfileStandalone . -t conductor_test_container
docker run -dit --name conductor_test_container -p 8899:8080 -p 4535:5000 -t conductor_test_container
COUNTER=0
MAX_TIME=120
while ! curl -s http://localhost:8899/api/metadata/workflow -o /dev/null
do
echo "$(date) - still trying"
echo "$(date) - still trying - since $COUNTER second, will wait for $MAX_TIME"
sleep 1
let COUNTER=COUNTER+1
if [ $COUNTER -gt $MAX_TIME ];
then
echo "Exceeded wait time of $MAX_TIME seconds. Terminating the build"
exit 1
fi
done
sleep 5
echo "All set - starting tests now"
Expand Down

0 comments on commit efe0573

Please sign in to comment.