Files
rssotto/Dockerfile
Jose Conde 760589a0ee Update
2025-10-24 16:56:04 +02:00

33 lines
757 B
Docker

# Use a JDK base image for building
FROM gradle:8.10.2-jdk17-alpine AS builder
# Set working directory
WORKDIR /app
# Copy build files
COPY build.gradle.kts settings.gradle.kts ./
COPY src ./src
# Build the application
RUN gradle build #--no-daemon
# Use a lightweight JRE image for running
FROM eclipse-temurin:17-alpine
# Set working directory
WORKDIR /app
# Install Chromium and ChromeDriver
RUN apk add --no-cache chromium chromium-chromedriver nss
ENV CHROME_BIN=/usr/bin/chromium-browser
ENV CHROMEDRIVER_BIN=/usr/bin/chromedriver
# Copy the built JAR from the builder stage
COPY --from=builder /app/build/libs/*.jar app.jar
# Expose the port (default for Spring Boot)
EXPOSE 8080
# Run the application
ENTRYPOINT ["java", "-jar", "app.jar"]