Update Dockerfile
Browse files- Dockerfile +5 -1
Dockerfile
CHANGED
|
@@ -18,6 +18,9 @@ RUN apt-get update -y && \
|
|
| 18 |
# Ensure /app is writable by the non-root user
|
| 19 |
RUN chown user:user /app
|
| 20 |
|
|
|
|
|
|
|
|
|
|
| 21 |
# Switch back to the non-root user
|
| 22 |
USER user
|
| 23 |
|
|
@@ -25,8 +28,9 @@ USER user
|
|
| 25 |
COPY --chown=user ./requirements.txt requirements.txt
|
| 26 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 27 |
|
| 28 |
-
# Copy the rest of the application code
|
| 29 |
COPY --chown=user . /app
|
|
|
|
| 30 |
|
| 31 |
# Set the command to run the application
|
| 32 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 18 |
# Ensure /app is writable by the non-root user
|
| 19 |
RUN chown user:user /app
|
| 20 |
|
| 21 |
+
# Create a directory for model weights
|
| 22 |
+
RUN mkdir -p /app/models && chown user:user /app/models
|
| 23 |
+
|
| 24 |
# Switch back to the non-root user
|
| 25 |
USER user
|
| 26 |
|
|
|
|
| 28 |
COPY --chown=user ./requirements.txt requirements.txt
|
| 29 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 30 |
|
| 31 |
+
# Copy the rest of the application code and model weights
|
| 32 |
COPY --chown=user . /app
|
| 33 |
+
COPY --chown=user ./models/resnet50-0676ba61.pth /app/models/resnet50-0676ba61.pth
|
| 34 |
|
| 35 |
# Set the command to run the application
|
| 36 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|