-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (23 loc) · 879 Bytes
/
Dockerfile
File metadata and controls
32 lines (23 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# ── Build stage ──
FROM eclipse-temurin:25-jdk-noble AS build
WORKDIR /app
# Cache Gradle wrapper + dependencies
COPY gradlew gradlew
COPY gradle gradle
RUN chmod +x gradlew && ./gradlew --version
COPY build.gradle.kts settings.gradle.kts ./
RUN ./gradlew dependencies --no-daemon || true
# Copy source and build (skip tests — they need network for Yahoo Finance)
COPY src src
RUN ./gradlew bootJar --no-daemon -x test -x sonarlintMain -x sonarlintTest -x pmdMain -x pmdTest
# ── Runtime stage ──
FROM eclipse-temurin:25-jre-noble
WORKDIR /app
RUN groupadd --system appuser && useradd --system --gid appuser appuser
COPY --from=build /app/build/libs/*.jar app.jar
RUN chown -R appuser:appuser /app
USER appuser
# Railway sets PORT env var; Spring reads SERVER_PORT automatically
ENV SERVER_PORT=8080
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "app.jar"]