File size: 1,479 Bytes
f5360be
4253152
ddd81fb
f5360be
d984e51
 
08c46f1
 
4253152
a17c6f2
2ae5aa4
f5360be
a17c6f2
ddd81fb
4253152
08c46f1
 
2ae5aa4
 
 
 
 
 
f5360be
 
2ae5aa4
 
08c46f1
d984e51
2ae5aa4
 
 
f5360be
2ae5aa4
f5360be
2ae5aa4
f5360be
2ae5aa4
 
 
f5360be
2ae5aa4
 
 
d65b1b7
4253152
2ae5aa4
 
f5360be
e1fb4f8
4253152
08c46f1
67189d4
2ae5aa4
 
e1fb4f8
4253152
08c46f1
d984e51
4253152
08c46f1
 
e7741c8
4253152
2ae5aa4
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Base image with JDK 21
FROM openjdk:21-jdk-slim

# Install all required packages including unzip
RUN apt-get update && \
    apt-get install -y \
    python3 \
    python3-pip \
    git \
    curl \
    wget \
    unzip \
    && rm -rf /var/lib/apt/lists/*

# Set Python3 as default
RUN ln -s /usr/bin/python3 /usr/bin/python

# Install Gradle
ENV GRADLE_VERSION=8.5
RUN wget -q https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip && \
    unzip -q gradle-${GRADLE_VERSION}-bin.zip && \
    mv gradle-${GRADLE_VERSION} /opt/gradle && \
    rm gradle-${GRADLE_VERSION}-bin.zip

# Add Gradle to PATH
ENV PATH=$PATH:/opt/gradle/bin

WORKDIR /app

# Clone coral-server repository
RUN git clone https://github.com/Coral-Protocol/coral-server.git /app/coral-server

# Try to build coral-server (allow failure)
WORKDIR /app/coral-server
RUN gradle build -x test || echo "Build failed, will retry at runtime"

# Check for JAR file
RUN if [ -f build/libs/*.jar ]; then \
        cp build/libs/*.jar /app/coral-server.jar; \
    else \
        echo "JAR not found, will use gradle run"; \
    fi

WORKDIR /app

# Install Python dependencies
RUN pip3 install --no-cache-dir \
    requests \
    psutil

# Copy Python wrapper
COPY coral_wrapper.py /app/

# Create config directory
RUN mkdir -p /config

# Expose port
EXPOSE 5555

# Environment variables
ENV JAVA_HOME=/usr/local/openjdk-21
ENV CORAL_PORT=5555

# Run Python wrapper
CMD ["python", "coral_wrapper.py"]