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
3 changes: 2 additions & 1 deletion docker/.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ exposePort=8091
########## DB ##############
spring.datasource.url=jdbc:postgresql://db:5432/postgres
spring.datasource.username=postgres
spring.datasource.password=postgres
spring.datasource.password=postgres
TOLGEE_POSTGRES_AUTOSTART_ENABLED=false
35 changes: 35 additions & 0 deletions docker/app/Dockerfile.lite
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM eclipse-temurin:21-alpine

RUN apk --no-cache add libxml2 bash

#############
### 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
Comment on lines +15 to +17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Use the canonical Spring Boot env var name.

Spring reads SPRING_PROFILES_ACTIVE; lower-case spring_profiles_active won’t be picked up by relaxed binding.

Apply this diff:

-ENV HEALTHCHECK_PORT=8080 \
-    spring_profiles_active=docker
+ENV HEALTHCHECK_PORT=8080 \
+    SPRING_PROFILES_ACTIVE=docker
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Environment variables for configuration
ENV HEALTHCHECK_PORT=8080 \
spring_profiles_active=docker
# Environment variables for configuration
ENV HEALTHCHECK_PORT=8080 \
SPRING_PROFILES_ACTIVE=docker
🤖 Prompt for AI Agents
In docker/app/Dockerfile.lite around lines 15 to 17, the environment variable
uses lower-case spring_profiles_active which Spring Boot won’t pick up; replace
it with the canonical upper-case SPRING_PROFILES_ACTIVE and keep the value set
to docker (e.g. ENV HEALTHCHECK_PORT=8080 \ SPRING_PROFILES_ACTIVE=docker) so
Spring recognizes the active profile.


# 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
Comment on lines +33 to +35
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Healthcheck may fail on Alpine due to wget availability/flags; prefer curl.

Alpine’s base often has BusyBox wget with limited flags (e.g., --spider may be unsupported). Install curl and use it in HEALTHCHECK to avoid false negatives.

Apply this diff:

-RUN apk --no-cache add libxml2 bash 
+RUN apk --no-cache add curl ca-certificates
@@
-HEALTHCHECK --interval=10s --timeout=3s --retries=20 \
-    CMD wget --spider -q "http://127.0.0.1:$HEALTHCHECK_PORT/actuator/health" || exit 1
+HEALTHCHECK --interval=10s --timeout=3s --retries=20 \
+    CMD curl -fsS "http://127.0.0.1:${HEALTHCHECK_PORT}/actuator/health" >/dev/null || exit 1

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In docker/app/Dockerfile.lite around lines 33 to 35, the HEALTHCHECK uses wget
with flags that may not exist in Alpine's BusyBox wget causing false failures;
replace the wget-based check with a curl-based check (e.g., curl --fail --silent
--show-error http://127.0.0.1:$HEALTHCHECK_PORT/actuator/health || exit 1) and
ensure curl is installed earlier in the Dockerfile (add apk add --no-cache curl
where packages are installed or in the build stage). Make the HEALTHCHECK use
curl and confirm the package installation occurs before the HEALTHCHECK line.

2 changes: 1 addition & 1 deletion docker/app/cmd.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh

ARCH=`uname -m`
if [ "$ARCH" = "aarch64" ]; then
Expand Down
3 changes: 3 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ services:
- POSTGRES_PASSWORD=postgres
app:
image: tolgee/tolgee
#build:
# context: ../build/docker
# dockerfile: Dockerfile.lite
ports:
- ${exposePort}:8080
env_file:
Expand Down