Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ jobs:
if: ${{ steps.version.outputs.VERSION != '' }}
run: |
docker buildx create --use
docker buildx build . -t tolgee/tolgee:${{ steps.version.outputs.VERSION }} --platform linux/arm64,linux/amd64 --cache-from type=registry,ref=tolgee/tolgee:latest --cache-to type=inline --push
docker buildx build . -t tolgee/tolgee:latest --platform linux/arm64,linux/amd64 --cache-from type=registry,ref=tolgee/tolgee:latest --cache-to type=inline --push
docker buildx build . -f legacy.Dockerfile -t tolgee/tolgee:${{ steps.version.outputs.VERSION }} --platform linux/arm64,linux/amd64 --cache-from type=registry,ref=tolgee/tolgee:latest --cache-to type=inline --push
docker buildx build . -f legacy.Dockerfile -t tolgee/tolgee:latest --platform linux/arm64,linux/amd64 --cache-from type=registry,ref=tolgee/tolgee:latest --cache-to type=inline --push
docker buildx build . -t tolgee/tolgee:${{ steps.version.outputs.VERSION }}-pg18 --platform linux/arm64,linux/amd64 --cache-from type=registry,ref=tolgee/tolgee:latest --cache-to type=inline --push
docker buildx build . -t tolgee/tolgee:latest-pg18 --platform linux/arm64,linux/amd64 --cache-from type=registry,ref=tolgee/tolgee:latest --cache-to type=inline --push
working-directory: build/docker

- name: Pack with webapp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class PostgresDockerRunner(
override fun run() {
instance =
DockerContainerRunner(
image = "postgres:16.3",
image = "postgres:18.0",
expose = mapOf(postgresAutostartProperties.port to "5432"),
waitForLog = "database system is ready to accept connections",
waitForLogTimesForNewContainer = 2,
Expand Down
7 changes: 6 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,12 @@ project(':server-app').afterEvaluate {
commandLine "docker", "rm", "--force", "--volumes", dbSchemaContainerName
}
exec {
commandLine "docker", "run", "-e", "POSTGRES_PASSWORD=postgres", "-d", "-p55538:5432", "--name", dbSchemaContainerName, "postgres:13"
commandLine "docker", "run",
"-e", "POSTGRES_PASSWORD=postgres",
"-d",
"-p55538:5432",
"--name", dbSchemaContainerName,
"postgres:18.0"
}
Thread.sleep(5000)
}
Expand Down
15 changes: 12 additions & 3 deletions docker/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
FROM postgres:13.21-alpine3.22
FROM postgres:18.0

ENTRYPOINT []

RUN apk --no-cache add openjdk21
RUN apk --no-cache add libxml2
RUN <<EOF
set -eux
apt -qq update
apt -qq -y install wget
wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor | tee /etc/apt/trusted.gpg.d/adoptium.gpg > /dev/null
echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list
apt -qq update
apt -qq -y install temurin-21-jdk libxml2
apt -qq -y remove wget --purge --auto-remove
rm -rf /var/lib/apt/lists/*
EOF

#############
### Tolgee #
Expand Down
39 changes: 39 additions & 0 deletions docker/app/legacy.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# TODO: remove for Tolgee 4 release
FROM postgres:13.21-alpine3.22

ENTRYPOINT []

RUN apk --no-cache add openjdk21
RUN apk --no-cache add libxml2

#############
### Tolgee #
#############

# Expose application port
EXPOSE 8080

# Define persistent volume for data storage
VOLUME /data

# Environment variables for configuration
ENV HEALTHCHECK_PORT=8080 \
spring_profiles_active=docker

# Copy necessary application files
COPY BOOT-INF/lib /app/lib
COPY META-INF /app/META-INF
COPY BOOT-INF/classes /app
COPY --chmod=755 cmd.sh /app

#################
### Let's go ##
#################

# Define the startup command
ENTRYPOINT ["/app/cmd.sh"]


# Health check to ensure the app is up and running
HEALTHCHECK --interval=10s --timeout=3s --retries=20 \
CMD wget --spider -q "http://127.0.0.1:$HEALTHCHECK_PORT/actuator/health" || exit 1
2 changes: 1 addition & 1 deletion docker/docker-compose.template.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
db:
image: postgres:11
image: postgres:18.0
environment:
- POSTGRES_PASSWORD=postgres
app:
Expand Down
4 changes: 2 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
db:
image: postgres:11
image: postgres:18.0
volumes:
- ../build/db-data:/var/lib/postgresql/data/
environment:
Expand All @@ -14,4 +14,4 @@ services:
depends_on:
- "db"
smtp:
image: namshi/smtp
image: namshi/smtp
22 changes: 16 additions & 6 deletions gradle/docker.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ task docker {
doLast {
exec {
workingDir dockerPath
commandLine "docker", "build", ".", "-t", "tolgee/tolgee", "--cache-from", "type=registry,ref=tolgee/tolgee:latest"
commandLine "docker", "build", ".", "-t", "tolgee/tolgee", "--cache-from", "type=registry,ref=tolgee/tolgee:latest-pg18"
}
exec {
workingDir dockerPath
commandLine "docker", "build", ".", "-f", "legacy.Dockerfile", "-t", "tolgee/tolgee", "--cache-from", "type=registry,ref=tolgee/tolgee:latest"
}
}
dependsOn("dockerPrepare")
}
Expand All @@ -32,13 +36,19 @@ void createDockerBuildxTask(String taskName, boolean isPush) {
doLast {
if (project.hasProperty('dockerImageTag')) {
def commandParams = ["docker", "buildx", "build", ".", "-t", project.property('dockerImageTag'), "--platform", "linux/arm64,linux/amd64"]
if (isPush) {
def commandParamsLegacy = ["docker", "buildx", "build", ".", "-f", "legacy.Dockerfile", "-t", project.property('dockerImageTag') + "-pg18", "--platform", "linux/arm64,linux/amd64"]
if (isPush) {
commandParams += ["--push"]
commandParamsLegacy += ["--push"]
}
exec {
workingDir dockerPath
commandLine commandParams
}
exec {
workingDir dockerPath
commandLine commandParams
}
exec {
workingDir dockerPath
commandLine commandParamsLegacy
}
} else {
throw new GradleException('A "dockerImageTag" project property must be defined! e.g. ./gradlew dockerBuildx -PdockerImageTag=myImageTag');
}
Expand Down
Loading