PanagiotisMark commited on
Commit
6d33a3b
·
verified ·
1 Parent(s): c667ed7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -15
Dockerfile CHANGED
@@ -1,23 +1,31 @@
1
- FROM intelligencenoborders/inobo:scinobo-claim-verification
 
2
 
3
- # Add user
4
- RUN useradd -m -u 1000 user
5
- RUN chown -R user /app
 
6
  USER user
 
7
  ENV HOME=/home/user \
8
- PATH=/home/user/.local/bin:$PATH
 
 
 
 
 
9
 
10
  # Set the working directory in the container
11
- WORKDIR /app/src
12
 
13
- # Expose the port that Gradio will run on
14
- EXPOSE 7860
15
 
16
- ENV PYTHONUNBUFFERED=1 \
17
- GRADIO_ALLOW_FLAGGING=never \
18
- GRADIO_NUM_PORTS=1 \
19
- GRADIO_SERVER_NAME=0.0.0.0 \
20
- SYSTEM=spaces
21
 
22
- # Run app.py when the container launches
23
- CMD ["python", "-m", "claim_analysis.server.gradio_app"]
 
1
+ # Use the official Python image from the Docker Hub
2
+ FROM python:3.9.19-slim
3
 
4
+ # Create the app directory and change its ownership
5
+ RUN mkdir /app && useradd -m -u 1000 user && chown -R user:user /app
6
+
7
+ # Switch to the user
8
  USER user
9
+ # Set environment variables
10
  ENV HOME=/home/user \
11
+ PATH=/home/user/.local/bin:$PATH \
12
+ PYTHONUNBUFFERED=1 \
13
+ GRADIO_ALLOW_FLAGGING=never \
14
+ GRADIO_NUM_PORTS=1 \
15
+ GRADIO_SERVER_NAME=0.0.0.0 \
16
+ SYSTEM=spaces
17
 
18
  # Set the working directory in the container
19
+ WORKDIR /app
20
 
21
+ # Copy the current directory contents into the container at /app
22
+ COPY --chown=user:user . /app
23
 
24
+ # Install any needed packages specified in requirements.txt
25
+ RUN pip install --no-cache-dir -r requirements.txt
26
+
27
+ # Expose the port the app runs on
28
+ EXPOSE 7860
29
 
30
+ # Run gradio_app.py when the container launches
31
+ CMD ["python", "gradio_app.py"]