Technologic101 commited on
Commit
b53073a
·
1 Parent(s): c7c5f29

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -6
Dockerfile CHANGED
@@ -23,17 +23,21 @@ RUN curl -sSL https://install.python-poetry.org | python - \
23
  USER user
24
  WORKDIR /app
25
 
26
- # Set up Python path
27
  ENV PATH="/home/user/.local/bin:$PATH"
28
  ENV PYTHONPATH=/app
29
  ENV PORT=7860
 
 
 
 
 
30
 
31
  # Copy dependency files with correct ownership
32
  COPY --chown=user pyproject.toml poetry.lock* ./
33
 
34
- # Install dependencies in user space
35
- RUN poetry config virtualenvs.create false \
36
- && poetry install --no-root --no-interaction --no-ansi
37
 
38
  # Copy application code
39
  COPY --chown=user . .
@@ -41,5 +45,5 @@ COPY --chown=user . .
41
  # Expose the port Chainlit runs on
42
  EXPOSE 7860
43
 
44
- # Command to run the Chainlit app
45
- CMD ["chainlit", "run", "src/app.py", "--host", "0.0.0.0", "--port", "7860"]
 
23
  USER user
24
  WORKDIR /app
25
 
26
+ # Set up Python path and Poetry config
27
  ENV PATH="/home/user/.local/bin:$PATH"
28
  ENV PYTHONPATH=/app
29
  ENV PORT=7860
30
+ ENV VIRTUAL_ENV=/home/user/.venv
31
+
32
+ # Configure Poetry to use virtualenvs
33
+ RUN poetry config virtualenvs.create true \
34
+ && poetry config virtualenvs.in-project true
35
 
36
  # Copy dependency files with correct ownership
37
  COPY --chown=user pyproject.toml poetry.lock* ./
38
 
39
+ # Install dependencies in virtualenv
40
+ RUN poetry install --no-root --no-interaction --no-ansi
 
41
 
42
  # Copy application code
43
  COPY --chown=user . .
 
45
  # Expose the port Chainlit runs on
46
  EXPOSE 7860
47
 
48
+ # Command to run the Chainlit app using Poetry
49
+ CMD ["poetry", "run", "chainlit", "run", "src/app.py", "--host", "0.0.0.0", "--port", "7860"]