File size: 840 Bytes
5dd3a67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM python:3.9-slim

WORKDIR /code

# Create logs directory with proper permissions
RUN mkdir -p /code/logs && chmod 777 /code/logs

# Copy application files
COPY ./requirements.txt /code/requirements.txt
COPY ./api.py /code/api.py
COPY ./json_parser.py /code/json_parser.py
COPY ./logger_config.py /code/logger_config.py
COPY ./response_formatter.py /code/response_formatter.py
COPY ./dify_client_python /code/dify_client_python

# Install dependencies
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

# Install dify_client_python in editable mode
WORKDIR /code/dify_client_python
RUN pip install -e .

# Return to main working directory
WORKDIR /code

# Ensure proper permissions for the entire code directory
RUN chown -R 1000:1000 /code

EXPOSE 7860

CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]