-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
138 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Build | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
validate: | ||
name: validate | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: | | ||
{ | ||
"dir": ${{ steps.set-matrix.outputs.dirs }} | ||
} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Validate | ||
uses: pre-commit/action@v3.0.0 | ||
|
||
- name: Configure matrix for test | ||
id: set-matrix | ||
run: | | ||
DIRS=$(find . -type f -name 'docker-compose.yml' -exec dirname "{}" \; | sort -u | jq -R | jq -s -c) | ||
echo "dirs=${DIRS}" >> "$GITHUB_OUTPUT" | ||
test: | ||
name: test | ||
runs-on: ubuntu-latest | ||
needs: validate | ||
strategy: | ||
matrix: ${{ fromJson(needs.validate.outputs.matrix) }} | ||
fail-fast: false | ||
max-parallel: 15 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Run containers | ||
timeout-minutes: 10 | ||
working-directory: ${{ matrix.dir }} | ||
run: | | ||
docker compose -f up -d --wait | ||
- name: Stop containers | ||
if: always() | ||
working-directory: ${{ matrix.dir }} | ||
run: | | ||
docker compose down -v | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
[![Build](https://github.com/Romanow/docker-compose-examples/actions/workflows/build.yaml/badge.svg?branch=master)](https://github.com/Romanow/docker-compose-examples/actions/workflows/build.yaml) | ||
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit) | ||
|
||
# Docker Compose examples | ||
|
||
* [Kafka](kafka/README.md) | ||
* [Monitoring](monitoring/README.md) | ||
* [Postgres](postgres/README.md) | ||
* [Logging](logging/README.md) | ||
* [ElasticSearch](elastic/README.md) | ||
* [Tracing](tracing/README.md) | ||
* [Elastic](elastic/README.md) | ||
* [Frontend](frontend/README.md) | ||
* [Java](java/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# ElasticSearch | ||
|
||
* [Single Node](docker-compose.single-node.yml) | ||
* [Single Node](docker-compose.yml) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Frontend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
services: | ||
simple-frontend: | ||
image: "romanowalex/simple-frontend:v2.0" | ||
container_name: simple-frontend | ||
ports: | ||
- "8080:80" | ||
healthcheck: | ||
test: "curl --fail http://localhost || exit 1" | ||
interval: 5s | ||
timeout: 3s | ||
retries: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM amazoncorretto:17 AS builder | ||
|
||
WORKDIR application | ||
COPY . . | ||
|
||
RUN ./gradlew clean assemble && \ | ||
mv build/libs/camunda-base.jar application.jar && \ | ||
java -Djarmode=layertools -jar application.jar extract | ||
|
||
FROM amazoncorretto:17 | ||
|
||
ENV JAVA_TOOL_OPTIONS="-XX:MaxRAMPercentage=75.0" | ||
|
||
WORKDIR application | ||
COPY --from=builder application/spring-boot-loader/ ./ | ||
COPY --from=builder application/dependencies/ ./ | ||
COPY --from=builder application/snapshot-dependencies/ ./ | ||
COPY --from=builder application/application/ ./ | ||
|
||
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM amazoncorretto:17 AS builder | ||
|
||
WORKDIR application | ||
|
||
ARG JAR_FILE=build/libs/echo-server.jar | ||
COPY ${JAR_FILE} application.jar | ||
|
||
RUN java -Djarmode=layertools -jar application.jar extract | ||
|
||
FROM amazoncorretto:17 | ||
|
||
ENV JAVA_TOOL_OPTIONS="-XX:MaxRAMPercentage=75.0" | ||
|
||
WORKDIR application | ||
|
||
COPY --from=builder application/spring-boot-loader/ ./ | ||
COPY --from=builder application/dependencies/ ./ | ||
COPY --from=builder application/snapshot-dependencies/ ./ | ||
COPY --from=builder application/application/ ./ | ||
|
||
ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: "3.9" | ||
services: | ||
echo-server: | ||
image: romanowalex/echo-server:v2.0 | ||
container_name: echo-server | ||
environment: | ||
SPRING_PROFILES_ACTIVE: simple | ||
ports: | ||
- "8080:8080" | ||
healthcheck: | ||
test: [ "CMD", "curl", "--silent", "--fail", "http://localhost:8080/manage/health" ] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Kafka and Zookeeper | ||
|
||
* [Single Node](docker-compose.standalone.yml) | ||
* [Single Node](docker-compose.yml) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
|
||
|
||
docker compose -f docker-compose.single-node.yml up -d --wait | ||
docker compose -f docker-compose.single-node.yml down -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Jaeger Tracing | ||
|
||
* [All-In-One](docker-compose.all-in-one.yml) | ||
* [All-In-One](docker-compose.yml) |
File renamed without changes.