Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dockerfile #2647

Merged
merged 1 commit into from
Oct 31, 2024
Merged
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
14 changes: 10 additions & 4 deletions docker/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ FROM tolgee/base:jdk-21-postgres-13
### 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
Expand All @@ -16,10 +23,9 @@ COPY BOOT-INF/classes /app
### Let's go ##
#################

ENV spring_profiles_active docker
# Define the startup command
CMD ["java", "-cp", "app:app/lib/*", "io.tolgee.Application"]

ENV HEALTHCHECK_PORT=8080

# Health check to ensure the app is up and running
HEALTHCHECK --interval=10s --timeout=3s --retries=20 \
CMD [[ "$(wget -q -O - http://127.0.0.1:$HEALTHCHECK_PORT/actuator/health)" == *"UP"* ]] || exit 1
CMD curl -f http://127.0.0.1:$HEALTHCHECK_PORT/actuator/health || exit 1
Loading