Update
This commit is contained in:
33
Dockerfile
Normal file
33
Dockerfile
Normal file
@@ -0,0 +1,33 @@
|
||||
# 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"]
|
||||
Reference in New Issue
Block a user