axnand commited on
Commit
dc54d81
·
1 Parent(s): 5ae9515

edited the dockerfile and .dockerignore and .gitignore

Browse files
Files changed (3) hide show
  1. .dockerignore +30 -13
  2. .gitignore +27 -24
  3. Dockerfile +4 -8
.dockerignore CHANGED
@@ -1,21 +1,38 @@
1
- # Ignore model cache, Python cache, and other unnecessary files
 
 
 
 
 
 
 
 
2
  __pycache__/
3
  *.pyc
4
  *.pyo
5
  *.pyd
 
 
6
  *.log
7
- *.sqlite
8
- *.db
9
 
10
- # Env and build artifacts
11
- venv/
12
- .env
13
- .env.*
14
- *.egg-info/
15
- dist/
16
- build/
17
- .idea/
18
  .vscode/
 
19
  *.bak
20
- .DS_Store
21
- node_modules/x
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ignore the venv
2
+ venv/
3
+ env/
4
+
5
+ # Git & metadata
6
+ .git
7
+ .gitignore
8
+
9
+ # Python cache
10
  __pycache__/
11
  *.pyc
12
  *.pyo
13
  *.pyd
14
+
15
+ # Logs
16
  *.log
 
 
17
 
18
+ # Docker ignore itself
19
+ .dockerignore
20
+
21
+ # Editor config
 
 
 
 
22
  .vscode/
23
+ *.swp
24
  *.bak
25
+
26
+ # Frontend-related stuff if not needed
27
+ frontend/
28
+ node_modules/
29
+ dist/
30
+ build/
31
+
32
+ # Tests, notebooks (optional)
33
+ tests/
34
+ *.ipynb
35
+
36
+ # Environment variables
37
+ .env
38
+ *.env
.gitignore CHANGED
@@ -1,36 +1,39 @@
1
- # Python
2
  __pycache__/
3
  *.py[cod]
4
- *.egg
5
- *.egg-info/
6
- *.pyo
7
- *.pyd
8
 
9
- # Virtual Environment
10
  venv/
 
 
 
 
 
 
 
11
  .env
12
- .venv/
13
 
14
- # Model caches
15
- .cache/
16
- *.bin
17
- *.pt
18
- *.ckpt
19
 
20
  # VSCode
21
  .vscode/
22
 
23
- # OS files
24
- .DS_Store
25
- Thumbs.db
26
-
27
- # Logs
28
- *.log
29
 
30
- # FastAPI/uvicorn logs
31
- *.log
32
- *.sqlite3
 
33
 
34
- # Ignore uploaded files or generated outputs
35
- outputs/
36
- hf_cache/
 
1
+ # Byte-compiled / optimized / DLL files
2
  __pycache__/
3
  *.py[cod]
4
+ *.so
 
 
 
5
 
6
+ # Virtual environments
7
  venv/
8
+ env/
9
+
10
+ # Hugging Face cache
11
+ /tmp/huggingface/
12
+ .huggingface/
13
+
14
+ # Environment variables
15
  .env
16
+ *.env
17
 
18
+ # Logs
19
+ *.log
20
+
21
+ # macOS
22
+ .DS_Store
23
 
24
  # VSCode
25
  .vscode/
26
 
27
+ # Node stuff (for frontend)
28
+ node_modules/
29
+ dist/
30
+ build/
 
 
31
 
32
+ # Pytest
33
+ htmlcov/
34
+ .cache/
35
+ .coverage
36
 
37
+ # Others
38
+ *.bak
39
+ *.swp
Dockerfile CHANGED
@@ -1,23 +1,19 @@
1
- # Base image
2
  FROM python:3.11-slim
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
- # Environment variables for better logging and HF cache
8
- ENV TRANSFORMERS_CACHE=/tmp/hf_cache \
9
  PYTHONUNBUFFERED=1 \
10
  PYTHONDONTWRITEBYTECODE=1
11
 
12
- # Install dependencies
 
13
  COPY requirements.txt .
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
- # Copy app code
17
  COPY app/ ./app/
18
 
19
- # Expose port for FastAPI
20
  EXPOSE 8000
21
 
22
- # Start the FastAPI server
23
  CMD ["uvicorn", "app.app:app", "--host", "0.0.0.0", "--port", "8000"]
 
 
1
  FROM python:3.11-slim
2
 
 
3
  WORKDIR /app
4
 
5
+ # Set environment variables
6
+ ENV HF_HOME=/tmp/huggingface \
7
  PYTHONUNBUFFERED=1 \
8
  PYTHONDONTWRITEBYTECODE=1
9
 
10
+ RUN mkdir -p /tmp/huggingface && chmod -R 777 /tmp/huggingface
11
+
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
 
15
  COPY app/ ./app/
16
 
 
17
  EXPOSE 8000
18
 
 
19
  CMD ["uvicorn", "app.app:app", "--host", "0.0.0.0", "--port", "8000"]