Update Dockerfile to optimize application setup and streamline dependencies
Browse files- Dockerfile +3 -6
Dockerfile
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
FROM python:3.12.7
|
| 2 |
|
|
|
|
|
|
|
| 3 |
RUN useradd -m -u 1000 user
|
| 4 |
USER user
|
| 5 |
ENV PATH="/home/user/.local/bin:$PATH"
|
|
@@ -9,10 +11,5 @@ WORKDIR /app
|
|
| 9 |
COPY --chown=user ./requirements.txt requirements.txt
|
| 10 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 11 |
|
| 12 |
-
USER root
|
| 13 |
-
RUN apt-get update && apt-get install -y \
|
| 14 |
-
libgl1 \
|
| 15 |
-
USER user
|
| 16 |
-
|
| 17 |
COPY --chown=user . /app
|
| 18 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
FROM python:3.12.7
|
| 2 |
|
| 3 |
+
RUN apt-get update && apt-get install -y libgl1 && rm -rf /var/lib/apt/lists/*
|
| 4 |
+
|
| 5 |
RUN useradd -m -u 1000 user
|
| 6 |
USER user
|
| 7 |
ENV PATH="/home/user/.local/bin:$PATH"
|
|
|
|
| 11 |
COPY --chown=user ./requirements.txt requirements.txt
|
| 12 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
COPY --chown=user . /app
|
| 15 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|