AurelioAguirre commited on
Commit
cd8667a
Β·
1 Parent(s): 0fcd272

Fixed Dockerfile v12

Browse files
Dockerfile CHANGED
@@ -3,7 +3,7 @@
3
  FROM python:3.12-slim
4
 
5
  # Set working directory
6
- WORKDIR /code
7
 
8
  # Copy requirements first to leverage Docker cache
9
  COPY requirements.txt .
@@ -12,20 +12,20 @@ COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
  # Create necessary directories and set permissions
15
- RUN mkdir -p /code/logs /code/hf_cache /code/app/.cache /code/models \
16
- && chmod 777 /code/logs /code/hf_cache /code/app/.cache /code/models
17
 
18
  # Copy the application code
19
- COPY ./app /code/app
20
- COPY ./utils /code/utils
21
 
22
  # Set environment variables
23
- ENV PYTHONPATH=/app
24
  ENV PYTHONUNBUFFERED=1
25
- ENV HF_HOME=/code/hf_cache
26
 
27
  # Expose the port (Hugging Face API runs on 7680)
28
  EXPOSE 7680
29
 
30
  # Command to run the application
31
- CMD ["python", "-m", "app.main"]
 
3
  FROM python:3.12-slim
4
 
5
  # Set working directory
6
+ WORKDIR /app
7
 
8
  # Copy requirements first to leverage Docker cache
9
  COPY requirements.txt .
 
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
  # Create necessary directories and set permissions
15
+ RUN mkdir -p /app/logs /app/hf_cache /app/app/.cache /app/models \
16
+ && chmod 777 /app/logs /app/hf_cache /app/app/.cache /app/models
17
 
18
  # Copy the application code
19
+ COPY main /app/main
20
+ COPY ./utils /app/utils
21
 
22
  # Set environment variables
23
+ ENV PYTHONPATH=/main
24
  ENV PYTHONUNBUFFERED=1
25
+ ENV HF_HOME=/app/hf_cache
26
 
27
  # Expose the port (Hugging Face API runs on 7680)
28
  EXPOSE 7680
29
 
30
  # Command to run the application
31
+ CMD ["python", "-m", "main.app"]
{app β†’ main}/__init__.py RENAMED
File without changes
{app β†’ main}/api.py RENAMED
File without changes
app/main.py β†’ main/app.py RENAMED
File without changes
{app β†’ main}/config.yaml RENAMED
@@ -14,7 +14,7 @@ model:
14
 
15
  folders:
16
  models: "models"
17
- cache: "app/.cache"
18
  logs: "logs"
19
 
20
  logging:
 
14
 
15
  folders:
16
  models: "models"
17
+ cache: "main/.cache"
18
  logs: "logs"
19
 
20
  logging:
{app β†’ main}/env_template RENAMED
File without changes
{app β†’ main}/routes.py RENAMED
File without changes