Really-amin commited on
Commit
e1c4108
·
verified ·
1 Parent(s): 578fb2d

Upload 5 files

Browse files
Files changed (2) hide show
  1. .dockerignore +12 -115
  2. Dockerfile +6 -14
.dockerignore CHANGED
@@ -1,121 +1,18 @@
1
- # Python
2
  __pycache__/
3
- *.py[cod]
4
- *$py.class
5
- *.so
6
- .Python
7
- build/
8
- develop-eggs/
9
- dist/
10
- downloads/
11
- eggs/
12
- .eggs/
13
- lib/
14
- lib64/
15
- parts/
16
- sdist/
17
- var/
18
- wheels/
19
- *.egg-info/
20
- .installed.cfg
21
- *.egg
22
- MANIFEST
23
- pip-log.txt
24
- pip-delete-this-directory.txt
25
-
26
- # Virtual environments
27
  venv/
28
- ENV/
29
- env/
30
- .venv
31
-
32
- # IDE
33
- .vscode/
34
- .idea/
35
- *.swp
36
- *.swo
37
- *~
38
- .DS_Store
39
-
40
- # Git
41
  .git/
42
  .gitignore
43
- .gitattributes
44
-
45
- # Documentation
46
- *.md
47
- docs/
48
- README*.md
49
- CHANGELOG.md
50
- LICENSE
51
-
52
- # Testing
53
- .pytest_cache/
54
- .coverage
55
- htmlcov/
56
- .tox/
57
- .hypothesis/
58
- tests/
59
- test_*.py
60
-
61
- # Logs and databases (will be created in container)
62
- *.log
63
- logs/
64
- data/*.db
65
- data/*.sqlite
66
- data/*.db-journal
67
-
68
- # Environment files (should be set via docker-compose or HF Secrets)
69
- .env
70
- .env.*
71
- !.env.example
72
-
73
- # Docker
74
- docker-compose*.yml
75
- !docker-compose.yml
76
- Dockerfile
77
- .dockerignore
78
-
79
- # CI/CD
80
- .github/
81
- .gitlab-ci.yml
82
- .travis.yml
83
- azure-pipelines.yml
84
-
85
- # Temporary files
86
- *.tmp
87
- *.bak
88
- *.swp
89
- temp/
90
- tmp/
91
-
92
- # Node modules (if any)
93
- node_modules/
94
- package-lock.json
95
- yarn.lock
96
-
97
- # OS files
98
- Thumbs.db
99
- .DS_Store
100
- desktop.ini
101
-
102
- # Jupyter notebooks
103
- .ipynb_checkpoints/
104
- *.ipynb
105
-
106
- # Model cache (models will be downloaded in container)
107
- models/
108
- .cache/
109
- .huggingface/
110
-
111
- # Large files that shouldn't be in image
112
  *.tar
113
  *.tar.gz
114
- *.zip
115
- *.rar
116
- *.7z
117
-
118
- # Screenshots and assets not needed
119
- screenshots/
120
- assets/*.png
121
- assets/*.jpg
 
 
1
  __pycache__/
2
+ *.pyc
3
+ *.pyo
4
+ *.pyd
5
+ *.sqlite3
6
+ *.db
7
+ *.log
8
+ .env
9
+ .venv/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  venv/
11
+ dist/
12
+ build/
 
 
 
 
 
 
 
 
 
 
 
13
  .git/
14
  .gitignore
15
+ *.zip
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  *.tar
17
  *.tar.gz
18
+ *.tgz
 
 
 
 
 
 
 
Dockerfile CHANGED
@@ -1,24 +1,16 @@
1
- FROM python:3.10
2
 
3
  WORKDIR /app
4
 
5
- # Create required directories
6
- RUN mkdir -p /app/logs /app/data /app/data/database /app/data/backups
7
 
8
- # Copy requirements and install dependencies
9
- COPY requirements.txt .
10
- RUN pip install --no-cache-dir -r requirements.txt
11
 
12
- # Copy application code
13
  COPY . .
14
 
15
- # Set environment variables
16
- ENV USE_MOCK_DATA=false
17
- ENV PORT=7860
18
- ENV PYTHONUNBUFFERED=1
19
 
20
- # Expose port
21
  EXPOSE 7860
22
 
23
- # Launch command
24
- CMD ["uvicorn", "hf_unified_server:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
 
5
+ ENV PIP_NO_CACHE_DIR=1 PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
 
6
 
7
+ COPY requirements_hf.txt ./requirements.txt
8
+ RUN pip install --upgrade pip && pip install -r requirements.txt
 
9
 
 
10
  COPY . .
11
 
12
+ ENV HF_MODE=off
 
 
 
13
 
 
14
  EXPOSE 7860
15
 
16
+ CMD ["sh", "-c", "uvicorn app:app --host 0.0.0.0 --port ${PORT:-7860}"]