NitinBot002 commited on
Commit
4253152
·
verified ·
1 Parent(s): f7aebfd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -24
Dockerfile CHANGED
@@ -1,46 +1,45 @@
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"]
 
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"]