Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +23 -24
Dockerfile
CHANGED
|
@@ -1,46 +1,45 @@
|
|
| 1 |
-
#
|
| 2 |
-
FROM openjdk:21-jdk
|
| 3 |
|
| 4 |
-
# Install Python and
|
| 5 |
RUN apt-get update && \
|
| 6 |
apt-get install -y \
|
| 7 |
python3 \
|
| 8 |
python3-pip \
|
| 9 |
-
|
|
|
|
| 10 |
curl \
|
| 11 |
-
wget \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
-
# Set Python3 as default
|
| 15 |
RUN ln -s /usr/bin/python3 /usr/bin/python
|
| 16 |
|
| 17 |
-
# Set working directory
|
| 18 |
WORKDIR /app
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
RUN
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
| 25 |
|
| 26 |
-
#
|
| 27 |
-
|
| 28 |
-
# OR if building from source:
|
| 29 |
-
# COPY coral-server/ /app/coral-server/
|
| 30 |
|
| 31 |
-
# Copy Python wrapper
|
| 32 |
COPY coral_wrapper.py /app/
|
| 33 |
|
| 34 |
-
# Create config
|
| 35 |
-
|
| 36 |
|
| 37 |
-
# Expose port
|
| 38 |
EXPOSE 5555
|
| 39 |
|
| 40 |
-
#
|
| 41 |
ENV JAVA_HOME=/usr/local/openjdk-21
|
| 42 |
-
ENV PATH=$JAVA_HOME/bin:$PATH
|
| 43 |
ENV CORAL_PORT=5555
|
|
|
|
| 44 |
|
| 45 |
-
# Run Python wrapper
|
| 46 |
-
|
|
|
|
| 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 \
|
| 8 |
python3-pip \
|
| 9 |
+
git \
|
| 10 |
+
gradle \
|
| 11 |
curl \
|
|
|
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
# Set Python3 as default
|
| 15 |
RUN ln -s /usr/bin/python3 /usr/bin/python
|
| 16 |
|
|
|
|
| 17 |
WORKDIR /app
|
| 18 |
|
| 19 |
+
# Clone and build coral-server
|
| 20 |
+
RUN git clone https://github.com/Coral-Protocol/coral-server.git && \
|
| 21 |
+
cd coral-server && \
|
| 22 |
+
gradle build -x test && \
|
| 23 |
+
cp build/libs/*.jar /app/coral-server.jar && \
|
| 24 |
+
cd .. && \
|
| 25 |
+
rm -rf coral-server
|
| 26 |
|
| 27 |
+
# Install Python dependencies
|
| 28 |
+
RUN pip3 install --no-cache-dir requests psutil
|
|
|
|
|
|
|
| 29 |
|
| 30 |
+
# Copy Python wrapper
|
| 31 |
COPY coral_wrapper.py /app/
|
| 32 |
|
| 33 |
+
# Create config volume
|
| 34 |
+
VOLUME ["/config"]
|
| 35 |
|
| 36 |
+
# Expose port
|
| 37 |
EXPOSE 5555
|
| 38 |
|
| 39 |
+
# Environment variables
|
| 40 |
ENV JAVA_HOME=/usr/local/openjdk-21
|
|
|
|
| 41 |
ENV CORAL_PORT=5555
|
| 42 |
+
ENV CORAL_JAR_PATH=/app/coral-server.jar
|
| 43 |
|
| 44 |
+
# Run Python wrapper
|
| 45 |
+
ENTRYPOINT ["python", "coral_wrapper.py"]
|