Severian commited on
Commit
28aafa3
·
verified ·
1 Parent(s): 7641cb4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -0
Dockerfile CHANGED
@@ -2,6 +2,10 @@ FROM python:3.9-slim
2
 
3
  WORKDIR /code
4
 
 
 
 
 
5
  COPY ./requirements.txt /code/requirements.txt
6
  COPY ./api.py /code/api.py
7
  COPY ./json_parser.py /code/json_parser.py
@@ -9,13 +13,19 @@ COPY ./logger_config.py /code/logger_config.py
9
  COPY ./response_formatter.py /code/response_formatter.py
10
  COPY ./dify_client_python /code/dify_client_python
11
 
 
12
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
13
 
 
14
  WORKDIR /code/dify_client_python
15
  RUN pip install -e .
16
 
 
17
  WORKDIR /code
18
 
 
 
 
19
  EXPOSE 7860
20
 
21
  CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]
 
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
 
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"]