KVAkash commited on
Commit
4b94e2f
1 Parent(s): cfb16b4

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Set the working directory in the container
5
+ WORKDIR /app
6
+
7
+ # Copy the environment YAML file and application code into the container
8
+ COPY environment.yml /app/environment.yml
9
+ COPY . /app
10
+
11
+ # Install conda and create the environment
12
+ RUN apt-get update && \
13
+ apt-get install -y curl && \
14
+ curl -sSLo /tmp/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
15
+ bash /tmp/miniconda.sh -b -p /opt/conda && \
16
+ rm /tmp/miniconda.sh && \
17
+ /opt/conda/bin/conda env create -f /app/environment.yml
18
+
19
+ # Make RUN commands use the new environment
20
+ SHELL ["conda", "run", "-n", "opera", "/bin/bash", "-c"]
21
+
22
+ # Install Node.js (required by Gradio for SSR)
23
+ RUN apt-get install -y nodejs npm && \
24
+ npm install -g n && \
25
+ n latest && \
26
+ export GRADIO_NODE_PATH=$(which node)
27
+
28
+ # Expose port for Hugging Face Spaces
29
+ EXPOSE 7860
30
+
31
+ # Run the application
32
+ CMD ["conda", "run", "-n", "opera", "streamlit", "run", "app.py", "--server.port=7860"]