Ansaribinhyder commited on
Commit
ffd135b
·
1 Parent(s): 97e62fa

With DOCKER

Browse files
Files changed (1) hide show
  1. Docker +40 -0
Docker ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
+ # you will also find guides on how best to write your Dockerfile
3
+
4
+ FROM python:3.12
5
+
6
+ # # Install system dependencies
7
+ # RUN apt-get update && apt-get install -y \
8
+ # portaudio19-dev \
9
+ # python3-dev \
10
+ # && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Install ALSA dependencies and other packages
13
+ RUN apt-get update && apt-get install -y \
14
+ alsa-utils \
15
+ libasound2 \
16
+ portaudio19-dev \
17
+ python3-dev \
18
+ && rm -rf /var/lib/apt/lists/*
19
+
20
+ # The two following lines are requirements for the Dev Mode to be functional
21
+ # Learn more about the Dev Mode at https://huggingface.co/dev-mode-explorers
22
+ RUN useradd -m -u 1000 user
23
+ WORKDIR /app
24
+
25
+ COPY requirements.txt .
26
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
27
+
28
+ COPY . .
29
+ # CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
30
+
31
+ # Set the environment variable for Flask
32
+ ENV FLASK_APP=main.py
33
+ ENV FLASK_RUN_HOST=0.0.0.0
34
+ ENV FLASK_RUN_PORT=7860
35
+
36
+ # Expose the port Flask will run on
37
+ EXPOSE 7860
38
+
39
+ # Command to run the Flask app
40
+ CMD ["flask", "run"]