TejasDalab commited on
Commit
f2109f5
·
1 Parent(s): ab6f2ff

Fix Dockerfile: Update Docker images and file permissions for HF Spaces deployment - No code logic changes

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -5
Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
  # Multi-stage build for da-autodelete microservice
2
  # Build stage
3
- FROM eclipse-temurin:21-jdk AS build
4
 
5
  # Set working directory
6
  WORKDIR /app
@@ -12,8 +12,10 @@ COPY build.gradle.kts .
12
  COPY settings.gradle.kts .
13
  COPY gradle.properties .
14
 
15
- # Make gradlew executable
16
- RUN chmod +x gradlew
 
 
17
 
18
  # Download dependencies
19
  RUN ./gradlew dependencies --no-daemon
@@ -25,7 +27,7 @@ COPY src src
25
  RUN ./gradlew build -x test --no-daemon
26
 
27
  # Runtime stage
28
- FROM eclipse-temurin:21-jre
29
 
30
  # Install curl for health checks
31
  RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
@@ -37,7 +39,9 @@ WORKDIR /app
37
  COPY --from=build /app/build/libs/*.jar app.jar
38
 
39
  # HF Spaces requires running as user with UID 1000
40
- RUN useradd -m -u 1000 -s /bin/bash appuser
 
 
41
  USER appuser
42
 
43
  # Expose the service port (HF Spaces will map this to the configured app_port)
 
1
  # Multi-stage build for da-autodelete microservice
2
  # Build stage
3
+ FROM openjdk:21-jdk-slim AS build
4
 
5
  # Set working directory
6
  WORKDIR /app
 
12
  COPY settings.gradle.kts .
13
  COPY gradle.properties .
14
 
15
+ # Fix file permissions for Linux container (Windows files lose permissions)
16
+ RUN chmod +x gradlew && \
17
+ chmod +x gradle/wrapper/gradle-wrapper.jar && \
18
+ chmod +x gradle/wrapper/gradle-wrapper.properties
19
 
20
  # Download dependencies
21
  RUN ./gradlew dependencies --no-daemon
 
27
  RUN ./gradlew build -x test --no-daemon
28
 
29
  # Runtime stage
30
+ FROM openjdk:21-slim
31
 
32
  # Install curl for health checks
33
  RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
 
39
  COPY --from=build /app/build/libs/*.jar app.jar
40
 
41
  # HF Spaces requires running as user with UID 1000
42
+ RUN useradd -m -u 1000 -s /bin/bash appuser && \
43
+ chown -R appuser:appuser /app
44
+
45
  USER appuser
46
 
47
  # Expose the service port (HF Spaces will map this to the configured app_port)