diff --git a/docker/.env b/docker/.env index da13cdcad5..aee6cec27f 100644 --- a/docker/.env +++ b/docker/.env @@ -2,4 +2,5 @@ exposePort=8091 ########## DB ############## spring.datasource.url=jdbc:postgresql://db:5432/postgres spring.datasource.username=postgres -spring.datasource.password=postgres \ No newline at end of file +spring.datasource.password=postgres +TOLGEE_POSTGRES_AUTOSTART_ENABLED=false \ No newline at end of file diff --git a/docker/app/Dockerfile.lite b/docker/app/Dockerfile.lite new file mode 100644 index 0000000000..aee8f54726 --- /dev/null +++ b/docker/app/Dockerfile.lite @@ -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 + +# 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 diff --git a/docker/app/cmd.sh b/docker/app/cmd.sh index 27a52ccae4..796e5f5f34 100644 --- a/docker/app/cmd.sh +++ b/docker/app/cmd.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh ARCH=`uname -m` if [ "$ARCH" = "aarch64" ]; then diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 3753a3a7c8..55a8d3be4d 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -7,6 +7,9 @@ services: - POSTGRES_PASSWORD=postgres app: image: tolgee/tolgee + #build: + # context: ../build/docker + # dockerfile: Dockerfile.lite ports: - ${exposePort}:8080 env_file: