Spaces:
Running
Running
Upload Dockerfile
Browse files- Dockerfile +31 -0
Dockerfile
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.9-slim
|
2 |
+
|
3 |
+
WORKDIR /code
|
4 |
+
|
5 |
+
# Create logs directory with proper permissions
|
6 |
+
RUN mkdir -p /code/logs && chmod 777 /code/logs
|
7 |
+
|
8 |
+
# Copy application files
|
9 |
+
COPY ./requirements.txt /code/requirements.txt
|
10 |
+
COPY ./api.py /code/api.py
|
11 |
+
COPY ./json_parser.py /code/json_parser.py
|
12 |
+
COPY ./logger_config.py /code/logger_config.py
|
13 |
+
COPY ./response_formatter.py /code/response_formatter.py
|
14 |
+
COPY ./dify_client_python /code/dify_client_python
|
15 |
+
|
16 |
+
# Install dependencies
|
17 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
18 |
+
|
19 |
+
# Install dify_client_python in editable mode
|
20 |
+
WORKDIR /code/dify_client_python
|
21 |
+
RUN pip install -e .
|
22 |
+
|
23 |
+
# Return to main working directory
|
24 |
+
WORKDIR /code
|
25 |
+
|
26 |
+
# Ensure proper permissions for the entire code directory
|
27 |
+
RUN chown -R 1000:1000 /code
|
28 |
+
|
29 |
+
EXPOSE 7860
|
30 |
+
|
31 |
+
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]
|