NitinBot002 commited on
Commit
7d76962
·
verified ·
1 Parent(s): e7741c8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -20
Dockerfile CHANGED
@@ -1,38 +1,28 @@
1
- # Use a base image that has both Python and Java
2
- FROM python:3.11-slim
3
 
4
- # Install Java (OpenJDK 17) and other dependencies
5
  RUN apt-get update && apt-get install -y \
6
- openjdk-17-jre-headless \
 
7
  curl \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
- # Set JAVA_HOME environment variable
11
- ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
12
- ENV PATH="${JAVA_HOME}/bin:${PATH}"
13
-
14
  # Set working directory
15
  WORKDIR /app
16
 
17
  # Upgrade pip
18
- RUN pip install --upgrade pip
19
 
20
- # Install coral-server from PyPI
21
- RUN pip install coral-server
22
 
23
  # Expose port 5555
24
  EXPOSE 5555
25
 
26
- # Create a non-root user to run the application
27
- RUN useradd -m -u 1000 coral && \
28
- chown -R coral:coral /app
29
-
30
- # Switch to non-root user
31
- USER coral
32
-
33
  # Health check
34
  HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
35
  CMD curl -f http://localhost:5555/health || exit 1
36
 
37
- # Run coral-server on port 5555
38
- CMD ["coral-server","--port", "5555"]
 
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 ["coral_protocol" ,"--port", "5555"]