Update Dockerfile
Browse files- Dockerfile +6 -8
Dockerfile
CHANGED
@@ -2,24 +2,22 @@ FROM python:3.10
|
|
2 |
# Set up a new user named "user" with user ID 1000
|
3 |
RUN useradd -m -u 1000 user
|
4 |
|
5 |
-
|
6 |
|
7 |
|
8 |
# Set home to the user's home directory
|
9 |
ENV HOME=/home/user \
|
10 |
PATH=/home/user/.local/bin:$PATH
|
11 |
-
RUN xargs apt-get install < ./paquetes.txt -y
|
12 |
# Set the working directory to the user's home directory
|
13 |
WORKDIR $HOME/app
|
14 |
-
|
|
|
|
|
|
|
15 |
USER user
|
16 |
# Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
|
17 |
RUN pip install --no-cache-dir --upgrade pip
|
18 |
-
|
19 |
-
#RUN sudo apt-get install texlive-full poppler-utils
|
20 |
-
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
21 |
-
COPY --chown=user . $HOME/app
|
22 |
-
|
23 |
|
24 |
EXPOSE 7080
|
25 |
CMD ["fastapi", "run", "app.py", "--port", "7080"]
|
|
|
2 |
# Set up a new user named "user" with user ID 1000
|
3 |
RUN useradd -m -u 1000 user
|
4 |
|
5 |
+
|
6 |
|
7 |
|
8 |
# Set home to the user's home directory
|
9 |
ENV HOME=/home/user \
|
10 |
PATH=/home/user/.local/bin:$PATH
|
|
|
11 |
# Set the working directory to the user's home directory
|
12 |
WORKDIR $HOME/app
|
13 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
14 |
+
COPY --chown=user . $HOME/app
|
15 |
+
RUN xargs apt-get install < ./paquetes.txt -y
|
16 |
+
# Switch to the "user" user
|
17 |
USER user
|
18 |
# Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
|
19 |
RUN pip install --no-cache-dir --upgrade pip
|
20 |
+
RUN pip install -r requirements.txt
|
|
|
|
|
|
|
|
|
21 |
|
22 |
EXPOSE 7080
|
23 |
CMD ["fastapi", "run", "app.py", "--port", "7080"]
|