euler314 commited on
Commit
a9dcc35
·
verified ·
1 Parent(s): 0dff88c

Upload 6 files

Browse files
Files changed (3) hide show
  1. .dockerignore +45 -0
  2. Dockerfile +74 -0
  3. packages.txt +2 -9
.dockerignore ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Git files
2
+ .git
3
+ .gitignore
4
+ .gitattributes
5
+
6
+ # Python cache
7
+ __pycache__/
8
+ *.py[cod]
9
+ *$py.class
10
+ *.so
11
+ .Python
12
+ *.egg-info/
13
+ dist/
14
+ build/
15
+
16
+ # Virtual environments
17
+ venv/
18
+ env/
19
+ ENV/
20
+
21
+ # IDE
22
+ .vscode/
23
+ .idea/
24
+ *.swp
25
+ *.swo
26
+ *~
27
+
28
+ # OS
29
+ .DS_Store
30
+ Thumbs.db
31
+
32
+ # Temporary files
33
+ *.tmp
34
+ *.log
35
+ .streamlit/
36
+
37
+ # Local test files
38
+ test/
39
+ tests/
40
+ *.test.py
41
+
42
+ # Documentation
43
+ docs/
44
+ *.md
45
+ !README.md
Dockerfile ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10
2
+
3
+ # Set working directory
4
+ WORKDIR /app
5
+
6
+ # Install system dependencies
7
+ RUN apt-get update && apt-get install -y \
8
+ git \
9
+ git-lfs \
10
+ ffmpeg \
11
+ libsm6 \
12
+ libxext6 \
13
+ cmake \
14
+ rsync \
15
+ libgl1 \
16
+ libcairo2-dev \
17
+ pkg-config \
18
+ python3-dev \
19
+ libpango1.0-dev \
20
+ texlive-latex-recommended \
21
+ texlive-fonts-recommended \
22
+ texlive-latex-extra \
23
+ fonts-dejavu-core \
24
+ libsndfile1 \
25
+ && rm -rf /var/lib/apt/lists/* \
26
+ && git lfs install
27
+
28
+ # Upgrade pip
29
+ RUN pip install --no-cache-dir pip -U
30
+
31
+ # Install HuggingFace dependencies
32
+ RUN pip install --no-cache-dir \
33
+ datasets \
34
+ "huggingface-hub>=0.30" \
35
+ "hf-transfer>=0.1.4" \
36
+ "protobuf<4" \
37
+ "click<8.1" \
38
+ "pydantic~=1.0"
39
+
40
+ # Copy requirements and install Python dependencies
41
+ COPY requirements.txt /app/requirements.txt
42
+ RUN pip install --no-cache-dir -r /app/requirements.txt
43
+
44
+ # Install Streamlit and required packages
45
+ RUN pip install --no-cache-dir \
46
+ streamlit==1.42.0 \
47
+ "uvicorn>=0.14.0" \
48
+ spaces
49
+
50
+ # Copy application files
51
+ COPY . /app
52
+
53
+ # Create necessary directories
54
+ RUN mkdir -p .streamlit && \
55
+ git config --global core.excludesfile ~/.gitignore && \
56
+ echo ".streamlit" > ~/.gitignore
57
+
58
+ # Create user directory
59
+ RUN mkdir -p /home/user && \
60
+ ( [ -e /home/user/app ] || ln -s /app/ /home/user/app ) || true
61
+
62
+ # Expose port
63
+ EXPOSE 7860
64
+
65
+ # Set environment variables
66
+ ENV GRADIO_SERVER_NAME="0.0.0.0"
67
+ ENV STREAMLIT_SERVER_PORT=7860
68
+ ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
69
+
70
+ # Health check
71
+ HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health || exit 1
72
+
73
+ # Run the application
74
+ CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
packages.txt CHANGED
@@ -1,9 +1,2 @@
1
- libcairo2-dev
2
- pkg-config
3
- python3-dev
4
- libpango1.0-dev
5
- texlive-latex-recommended
6
- texlive-fonts-recommended
7
- texlive-latex-extra
8
- fonts-dejavu-core
9
- libsndfile1
 
1
+ # All system packages are now installed via Dockerfile
2
+ # This file is kept for compatibility but not used