Skip to content

Commit

Permalink
docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
v1r3n committed Dec 19, 2023
1 parent 6445f3b commit 5ef4cfd
Show file tree
Hide file tree
Showing 11 changed files with 153 additions and 74 deletions.
88 changes: 88 additions & 0 deletions docker/docker-compose-postgres-es7.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
version: '2.3'

services:
conductor-server:
environment:
- CONFIG_PROP=config-postgres-es7.properties
image: conductor:server
container_name: conductor-server
build:
context: ../
dockerfile: docker/server/Dockerfile
networks:
- internal
ports:
- 8080:8080
- 5000:5000
healthcheck:
test: [ "CMD", "curl","-I" ,"-XGET", "http://localhost:8080/health" ]
interval: 60s
timeout: 30s
retries: 12
links:
- conductor-postgres:postgresdb
- conductor-elasticsearch:es
depends_on:
conductor-postgres:
condition: service_healthy
conductor-elasticsearch:
condition: service_healthy
logging:
driver: "json-file"
options:
max-size: "1k"
max-file: "3"

conductor-postgres:
image: postgres
environment:
- POSTGRES_USER=conductor
- POSTGRES_PASSWORD=conductor
volumes:
- pgdata-conductor:/var/lib/postgresql/data
networks:
- internal
ports:
- 6432:5432
healthcheck:
test: timeout 5 bash -c 'cat < /dev/null > /dev/tcp/localhost/5432'
interval: 5s
timeout: 5s
retries: 12
logging:
driver: "json-file"
options:
max-size: "1k"
max-file: "3"

conductor-elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.11
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx1024m"
- xpack.security.enabled=false
- discovery.type=single-node
volumes:
- esdata-conductor:/usr/share/elasticsearch/data
networks:
- internal
ports:
- 9201:9200
healthcheck:
test: curl http://localhost:9200/_cluster/health -o /dev/null
interval: 5s
timeout: 5s
retries: 12
logging:
driver: "json-file"
options:
max-size: "1k"
max-file: "3"

volumes:
pgdata-conductor:
driver: local
esdata-conductor:
driver: local

networks:
internal:
28 changes: 0 additions & 28 deletions docker/docker-compose-postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ services:
timeout: 30s
retries: 12
links:
- conductor-elasticsearch:es
- conductor-postgres:postgresdb
depends_on:
conductor-elasticsearch:
condition: service_healthy
conductor-postgres:
condition: service_healthy
logging:
Expand Down Expand Up @@ -55,34 +52,9 @@ services:
max-size: "1k"
max-file: "3"

conductor-elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.11
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx1024m"
- xpack.security.enabled=false
- discovery.type=single-node
volumes:
- esdata-conductor:/usr/share/elasticsearch/data
networks:
- internal
ports:
- 9201:9200
healthcheck:
test: curl http://localhost:9200/_cluster/health -o /dev/null
interval: 5s
timeout: 5s
retries: 12
logging:
driver: "json-file"
options:
max-size: "1k"
max-file: "3"

volumes:
pgdata-conductor:
driver: local
esdata-conductor:
driver: local

networks:
internal:
52 changes: 24 additions & 28 deletions docker/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,52 +1,48 @@
#
# conductor:server - Combined conductor server & UI
# conductor:server - Build Conductor Server
#
# ===========================================================================================================
# 0. Builder stage
# 0. Builder stage 1
# ===========================================================================================================
FROM alpine:3.18 AS builder
FROM openjdk:17-bullseye AS builder

LABEL maintainer="Orkes OSS <oss@orkes.io>"

# 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
#
# ===========================================================================================================
# 0. Build Conductor Server
# 1. Builder stage 2
# ===========================================================================================================
FROM alpine:3.18 AS ui-builder

LABEL maintainer="Orkes OSS <oss@orkes.io>"

# Install dependencies
RUN apk add openjdk17
RUN apk add git
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"

# Checkout the community project
WORKDIR /
RUN mkdir server-build
WORKDIR server-build
RUN ls -ltr

RUN git clone https://github.com/conductor-oss/conductor-community.git

# Copy the project directly onto the image
WORKDIR conductor-community
RUN ls -ltr

# Build the server on run
RUN ./gradlew build -x test --stacktrace
WORKDIR /server-build
RUN ls -ltr
RUN pwd


# ===========================================================================================================
# 1. Bin stage
# 2. Bin stage
# ===========================================================================================================
FROM alpine:3.18

Expand All @@ -61,13 +57,13 @@ 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 /server-build/conductor-community/community-server/build/libs/*boot*.jar /app/libs/conductor-server.jar
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=builder /conductor/ui/build .
COPY --from=builder /conductor/docker/server/nginx/nginx.conf /etc/nginx/http.d/default.conf
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
Expand Down
6 changes: 5 additions & 1 deletion docker/server/config/config-mysql.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Database persistence type.
conductor.db.type=mysql


# mysql
spring.datasource.url=jdbc:mysql://mysql:3306/conductor
spring.datasource.username=conductor
spring.datasource.password=conductor

# Use redis queues
# redis queues
conductor.queue.type=redis_standalone
conductor.redis.hosts=rs:6379:us-east-1c
conductor.redis-lock.serverAddress=redis://rs:6379


# Elastic search instance indexing is enabled.
conductor.indexing.enabled=true
Expand Down
23 changes: 23 additions & 0 deletions docker/server/config/config-postgres-es7.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Database persistence type.
conductor.db.type=postgres
conductor.queue.type=postgres
conductor.external-payload-storage.type=postgres

# postgres
spring.datasource.url=jdbc:postgresql://postgresdb:5432/postgres
spring.datasource.username=conductor
spring.datasource.password=conductor

# Elastic search instance indexing is enabled.
conductor.indexing.enabled=true
conductor.elasticsearch.url=http://es:9200
conductor.elasticsearch.indexName=conductor
conductor.elasticsearch.version=7
conductor.elasticsearch.clusterHealthColor=yellow

# Additional modules for metrics collection exposed to Prometheus (optional)
conductor.metrics-prometheus.enabled=true
management.endpoints.web.exposure.include=prometheus

# Load sample kitchen-sink workflow
loadSample=true
16 changes: 9 additions & 7 deletions docker/server/config/config-postgres.properties
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# Database persistence type.
conductor.db.type=postgres
conductor.queue.type=postgres
conductor.external-payload-storage.type=postgres

# postgres
# Database connectivity
spring.datasource.url=jdbc:postgresql://postgresdb:5432/postgres
spring.datasource.username=conductor
spring.datasource.password=conductor

# Elastic search instance indexing is enabled.

# Indexing Properties
conductor.indexing.enabled=true
conductor.elasticsearch.url=http://es:9200
conductor.elasticsearch.indexName=conductor
conductor.elasticsearch.version=7
conductor.elasticsearch.clusterHealthColor=yellow
conductor.indexing.type=postgres
# Required to disable connecting to elasticsearch.
conductor.elasticsearch.version=0

# Additional modules for metrics collection exposed to Prometheus (optional)
conductor.metrics-prometheus.enabled=true
management.endpoints.web.exposure.include=prometheus

# Load sample kitchen-sink workflow
loadSample=true
loadSample=true
5 changes: 2 additions & 3 deletions docker/server/config/config-redis.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# Database persistence type.
# Below are the properties for redis
conductor.db.type=redis_standalone
conductor.queue.type=redis_standalone

conductor.redis.hosts=rs:6379:us-east-1c
conductor.redis-lock.serverAddress=redis://rs:6379
conductor.redis.taskDefCacheRefreshInterval=1
conductor.redis.workflowNamespacePrefix=conductor
conductor.redis.queueNamespacePrefix=conductor_queues

#Use redis queues
conductor.queue.type=redis_standalone

# Elastic search instance indexing is enabled.
conductor.indexing.enabled=true
conductor.elasticsearch.url=http://es:9200
Expand Down
2 changes: 1 addition & 1 deletion docker/server/config/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# db.type determines the type of database used
# See various configurations below for the values
conductor.db.type=SET_THIS
#conductor.db.type=SET_THIS

# =====================================================#
# Redis Configuration Properties
Expand Down
2 changes: 1 addition & 1 deletion docker/ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# conductor:ui - Netflix Conductor UI
#
FROM node:20-alpine
LABEL maintainer="Netflix OSS <conductor@netflix.com>"
LABEL maintainer="Orkes OSS <oss@orkes.io>"

# Install the required packages for the node build
# to run on alpine
Expand Down
3 changes: 0 additions & 3 deletions mysql-persistence/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ dependencies {

testImplementation "org.apache.groovy:groovy-all:${revGroovy}"


testImplementation "org.elasticsearch:elasticsearch:6.8.23"
testImplementation "org.elasticsearch.client:transport:6.8.23"
testImplementation "org.elasticsearch.client:elasticsearch-rest-client:6.8.23"
testImplementation "org.elasticsearch.client:elasticsearch-rest-high-level-client:6.8.23"
testImplementation "org.testcontainers:elasticsearch:${revTestContainer}"
Expand Down
2 changes: 0 additions & 2 deletions postgres-persistence/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ dependencies {

testImplementation "org.apache.groovy:groovy-all:${revGroovy}"

// testImplementation "org.elasticsearch:elasticsearch:6.8.23"
// testImplementation "org.elasticsearch.client:transport:6.8.23"
testImplementation "org.elasticsearch.client:elasticsearch-rest-client:6.8.23"
testImplementation "org.elasticsearch.client:elasticsearch-rest-high-level-client:6.8.23"
testImplementation "org.testcontainers:elasticsearch:${revTestContainer}"
Expand Down

0 comments on commit 5ef4cfd

Please sign in to comment.