NitinBot002 commited on
Commit
08c46f1
·
verified ·
1 Parent(s): 8b24bef

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -29
Dockerfile CHANGED
@@ -1,43 +1,46 @@
1
- # Use OpenJDK 21 (latest LTS version > 17)
2
- FROM openjdk:21-jdk-slim
3
 
4
- # Set working directory
5
- WORKDIR /app
6
-
7
- # Install necessary tools
8
  RUN apt-get update && \
9
  apt-get install -y \
 
 
 
10
  curl \
11
- git \
12
  wget \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
- # Install Gradle (if not using gradle wrapper)
16
- ENV GRADLE_VERSION=8.5
17
- RUN wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip && \
18
- unzip gradle-${GRADLE_VERSION}-bin.zip && \
19
- mv gradle-${GRADLE_VERSION} /opt/gradle && \
20
- rm gradle-${GRADLE_VERSION}-bin.zip
21
- ENV PATH=$PATH:/opt/gradle/bin
22
 
23
- # Copy the coral-server source code
24
- COPY . /app
 
 
 
25
 
26
- # If cloning from repository instead of COPY, uncomment below:
27
- # RUN git clone https://github.com/Coral-Protocol/coral-server.git /app
 
 
28
 
29
- # Build the application
30
- RUN gradle build -x test
31
 
32
- # Expose the default SSE server port
33
- EXPOSE 5555
34
 
35
- # Create volume for configuration
36
- VOLUME ["/config"]
37
 
38
- # Set default environment variables
39
- ENV CORAL_SERVER_PORT=5555
40
- ENV CORAL_SERVER_MODE=sse-server-ktor
 
41
 
42
- # Run the application (SSE server mode on port 5555 by default)
43
- CMD ["sh", "-c", "gradle run --args='--${CORAL_SERVER_MODE} ${CORAL_SERVER_PORT}'"]
 
1
+ # Use a base image with both Python and JDK 21
2
+ FROM openjdk:21-jdk
3
 
4
+ # Install Python and required packages
 
 
 
5
  RUN apt-get update && \
6
  apt-get install -y \
7
+ python3 \
8
+ python3-pip \
9
+ python3-venv \
10
  curl \
 
11
  wget \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # Set Python3 as default python
15
+ RUN ln -s /usr/bin/python3 /usr/bin/python
16
+
17
+ # Set working directory
18
+ WORKDIR /app
 
 
19
 
20
+ # Install Python dependencies
21
+ RUN pip3 install --no-cache-dir \
22
+ docker \
23
+ requests \
24
+ psutil
25
 
26
+ # Copy coral-server JAR or source
27
+ COPY coral-server.jar /app/
28
+ # OR if building from source:
29
+ # COPY coral-server/ /app/coral-server/
30
 
31
+ # Copy Python wrapper script
32
+ COPY coral_wrapper.py /app/
33
 
34
+ # Create config directory
35
+ RUN mkdir -p /config
36
 
37
+ # Expose port 5555
38
+ EXPOSE 5555
39
 
40
+ # Set environment variables
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 as entry point
46
+ CMD ["python", "coral_wrapper.py"]