Spaces:
Paused
Paused
Commit
Β·
cd8667a
1
Parent(s):
0fcd272
Fixed Dockerfile v12
Browse files- Dockerfile +8 -8
- {app β main}/__init__.py +0 -0
- {app β main}/api.py +0 -0
- app/main.py β main/app.py +0 -0
- {app β main}/config.yaml +1 -1
- {app β main}/env_template +0 -0
- {app β main}/routes.py +0 -0
Dockerfile
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
FROM python:3.12-slim
|
4 |
|
5 |
# Set working directory
|
6 |
-
WORKDIR /
|
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 /
|
16 |
-
&& chmod 777 /
|
17 |
|
18 |
# Copy the application code
|
19 |
-
COPY
|
20 |
-
COPY ./utils /
|
21 |
|
22 |
# Set environment variables
|
23 |
-
ENV PYTHONPATH=/
|
24 |
ENV PYTHONUNBUFFERED=1
|
25 |
-
ENV HF_HOME=/
|
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
|
|
|
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: "
|
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
|