NitinBot002 commited on
Commit
f5360be
·
verified ·
1 Parent(s): 2ae5aa4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -10
Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
- # Base image with Python and JDK 21
2
  FROM openjdk:21-jdk-slim
3
 
4
- # Install Python, Git, and build tools
5
  RUN apt-get update && \
6
  apt-get install -y \
7
  python3 \
@@ -9,6 +9,7 @@ RUN apt-get update && \
9
  git \
10
  curl \
11
  wget \
 
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
  # Set Python3 as default
@@ -20,6 +21,8 @@ RUN wget -q https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-b
20
  unzip -q gradle-${GRADLE_VERSION}-bin.zip && \
21
  mv gradle-${GRADLE_VERSION} /opt/gradle && \
22
  rm gradle-${GRADLE_VERSION}-bin.zip
 
 
23
  ENV PATH=$PATH:/opt/gradle/bin
24
 
25
  WORKDIR /app
@@ -27,17 +30,15 @@ WORKDIR /app
27
  # Clone coral-server repository
28
  RUN git clone https://github.com/Coral-Protocol/coral-server.git /app/coral-server
29
 
30
- # Build coral-server
31
  WORKDIR /app/coral-server
32
- RUN gradle build -x test || true
33
 
34
- # Check if JAR was built and copy it
35
  RUN if [ -f build/libs/*.jar ]; then \
36
  cp build/libs/*.jar /app/coral-server.jar; \
37
  else \
38
- echo "JAR not found in build/libs, checking other locations..."; \
39
- find . -name "*.jar" -type f | head -1 | xargs -I {} cp {} /app/coral-server.jar || \
40
- echo "Warning: No JAR file found, will need to run gradle at runtime"; \
41
  fi
42
 
43
  WORKDIR /app
@@ -45,8 +46,7 @@ WORKDIR /app
45
  # Install Python dependencies
46
  RUN pip3 install --no-cache-dir \
47
  requests \
48
- psutil \
49
- pyyaml
50
 
51
  # Copy Python wrapper
52
  COPY coral_wrapper.py /app/
 
1
+ # Base image with JDK 21
2
  FROM openjdk:21-jdk-slim
3
 
4
+ # Install all required packages including unzip
5
  RUN apt-get update && \
6
  apt-get install -y \
7
  python3 \
 
9
  git \
10
  curl \
11
  wget \
12
+ unzip \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
  # Set Python3 as default
 
21
  unzip -q gradle-${GRADLE_VERSION}-bin.zip && \
22
  mv gradle-${GRADLE_VERSION} /opt/gradle && \
23
  rm gradle-${GRADLE_VERSION}-bin.zip
24
+
25
+ # Add Gradle to PATH
26
  ENV PATH=$PATH:/opt/gradle/bin
27
 
28
  WORKDIR /app
 
30
  # Clone coral-server repository
31
  RUN git clone https://github.com/Coral-Protocol/coral-server.git /app/coral-server
32
 
33
+ # Try to build coral-server (allow failure)
34
  WORKDIR /app/coral-server
35
+ RUN gradle build -x test || echo "Build failed, will retry at runtime"
36
 
37
+ # Check for JAR file
38
  RUN if [ -f build/libs/*.jar ]; then \
39
  cp build/libs/*.jar /app/coral-server.jar; \
40
  else \
41
+ echo "JAR not found, will use gradle run"; \
 
 
42
  fi
43
 
44
  WORKDIR /app
 
46
  # Install Python dependencies
47
  RUN pip3 install --no-cache-dir \
48
  requests \
49
+ psutil
 
50
 
51
  # Copy Python wrapper
52
  COPY coral_wrapper.py /app/