NitinBot002 commited on
Commit
d984e51
·
verified ·
1 Parent(s): 0adb56a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +33 -18
Dockerfile CHANGED
@@ -1,28 +1,43 @@
1
- # Use official OpenJDK image as base
2
- FROM openjdk:17-jre-slim
3
 
4
- # Install Python and pip
5
- RUN apt-get update && apt-get install -y \
6
- python3 \
7
- python3-pip \
 
 
8
  curl \
 
 
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # Set working directory
12
- WORKDIR /app
 
 
 
 
 
 
 
 
13
 
14
- # Upgrade pip
15
- RUN python3 -m pip install --upgrade pip
16
 
17
- # Install coral-server
18
- RUN python3 -m pip install coral-server
19
 
20
- # Expose port 5555
21
  EXPOSE 5555
22
 
23
- # Health check
24
- HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
25
- CMD curl -f http://localhost:5555/health || exit 1
 
 
 
26
 
27
- # Run coral-server
28
- CMD ["corol-server" ,"--port", "5555"]
 
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}'"]