chore: Update Dockerfile to improve build process and upgrade pip
Browse files- Dockerfile +10 -6
Dockerfile
CHANGED
@@ -1,9 +1,16 @@
|
|
1 |
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
2 |
# you will also find guides on how best to write your Dockerfile
|
3 |
|
|
|
|
|
|
|
4 |
# Use the official Python 3.10 slim image as the base image
|
5 |
FROM tiangolo/uvicorn-gunicorn:python3.10-slim
|
6 |
|
|
|
|
|
|
|
|
|
7 |
# Set up a new user named "user" with user ID 1000
|
8 |
RUN useradd -m -u 1000 user
|
9 |
|
@@ -19,16 +26,13 @@ ENV HOME=/home/user \
|
|
19 |
PATH=/home/user/.local/bin:$PATH
|
20 |
|
21 |
# Set the working directory to the user's home directory
|
22 |
-
WORKDIR
|
23 |
|
24 |
# Upgrade pip
|
25 |
RUN pip install --no-cache-dir --upgrade pip
|
26 |
|
27 |
-
# Copy the current directory contents into the container at
|
28 |
-
COPY --chown=user .
|
29 |
-
|
30 |
-
# Set the working directory
|
31 |
-
WORKDIR /app
|
32 |
|
33 |
# List the contents of the working directory to debug
|
34 |
RUN ls -la
|
|
|
1 |
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
2 |
# you will also find guides on how best to write your Dockerfile
|
3 |
|
4 |
+
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
5 |
+
# you will also find guides on how best to write your Dockerfile
|
6 |
+
|
7 |
# Use the official Python 3.10 slim image as the base image
|
8 |
FROM tiangolo/uvicorn-gunicorn:python3.10-slim
|
9 |
|
10 |
+
# Install necessary tools
|
11 |
+
USER root
|
12 |
+
RUN apt-get update && apt-get install -y wget tar
|
13 |
+
|
14 |
# Set up a new user named "user" with user ID 1000
|
15 |
RUN useradd -m -u 1000 user
|
16 |
|
|
|
26 |
PATH=/home/user/.local/bin:$PATH
|
27 |
|
28 |
# Set the working directory to the user's home directory
|
29 |
+
WORKDIR /home/user/app
|
30 |
|
31 |
# Upgrade pip
|
32 |
RUN pip install --no-cache-dir --upgrade pip
|
33 |
|
34 |
+
# Copy the current directory contents into the container at /home/user/app
|
35 |
+
COPY --chown=user . .
|
|
|
|
|
|
|
36 |
|
37 |
# List the contents of the working directory to debug
|
38 |
RUN ls -la
|