Spaces:
Build error
Build error
Commit
·
c633b82
1
Parent(s):
7202336
Create a Symlink to a System-wide Location
Browse files- Dockerfile +8 -5
Dockerfile
CHANGED
@@ -9,13 +9,16 @@ RUN curl -sSL https://install.python-poetry.org | python3 -
|
|
9 |
# Set Poetry path (ensures it's available in future RUN commands)
|
10 |
ENV PATH="/root/.local/bin:$PATH"
|
11 |
|
|
|
|
|
|
|
12 |
# Set working directory
|
13 |
WORKDIR /code
|
14 |
|
15 |
# Copy Poetry files first to optimize Docker caching
|
16 |
COPY pyproject.toml poetry.lock /code/
|
17 |
|
18 |
-
# Install dependencies
|
19 |
RUN poetry install --no-root --no-interaction --no-ansi
|
20 |
|
21 |
# Copy the rest of the project files
|
@@ -31,11 +34,11 @@ RUN mkdir -p /code/uploaded_videos /code/output_frames \
|
|
31 |
# Switch to non-root user
|
32 |
USER 1000
|
33 |
|
34 |
-
# Set Poetry environment for user
|
35 |
-
ENV PATH="/home/user/.local/bin:$PATH"
|
36 |
-
|
37 |
# Expose the application port
|
38 |
EXPOSE 8000
|
39 |
|
40 |
-
#
|
|
|
|
|
|
|
41 |
CMD ["poetry", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
9 |
# Set Poetry path (ensures it's available in future RUN commands)
|
10 |
ENV PATH="/root/.local/bin:$PATH"
|
11 |
|
12 |
+
# Create a symlink so Poetry is accessible system-wide
|
13 |
+
RUN ln -s /root/.local/bin/poetry /usr/local/bin/poetry
|
14 |
+
|
15 |
# Set working directory
|
16 |
WORKDIR /code
|
17 |
|
18 |
# Copy Poetry files first to optimize Docker caching
|
19 |
COPY pyproject.toml poetry.lock /code/
|
20 |
|
21 |
+
# Install dependencies using Poetry
|
22 |
RUN poetry install --no-root --no-interaction --no-ansi
|
23 |
|
24 |
# Copy the rest of the project files
|
|
|
34 |
# Switch to non-root user
|
35 |
USER 1000
|
36 |
|
|
|
|
|
|
|
37 |
# Expose the application port
|
38 |
EXPOSE 8000
|
39 |
|
40 |
+
# Ensure logs are not buffered
|
41 |
+
ENV PYTHONUNBUFFERED=1
|
42 |
+
|
43 |
+
# Run the application using Poetry's virtual environment
|
44 |
CMD ["poetry", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|