ThomasBlumet
commited on
Commit
·
2a9204a
1
Parent(s):
3140179
update again the docker image
Browse files- Dockerfile +14 -5
Dockerfile
CHANGED
@@ -1,19 +1,28 @@
|
|
1 |
# For more information, please refer to https://aka.ms/vscode-docker-python
|
2 |
-
FROM python:3.9
|
3 |
|
4 |
# Where we'll copy the code
|
5 |
WORKDIR /code
|
6 |
|
7 |
-
# Creates a non-root user with an explicit UID
|
8 |
# For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers
|
9 |
-
RUN useradd -m -u 1000 appuser
|
10 |
USER appuser
|
11 |
|
12 |
-
#
|
13 |
COPY ./requirements.txt /code/requirements.txt
|
|
|
14 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
15 |
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
# During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug
|
19 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
# For more information, please refer to https://aka.ms/vscode-docker-python
|
2 |
+
FROM python:3.9
|
3 |
|
4 |
# Where we'll copy the code
|
5 |
WORKDIR /code
|
6 |
|
7 |
+
# Creates a non-root user with an explicit UID
|
8 |
# For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers
|
9 |
+
RUN useradd -m -u 1000 appuser
|
10 |
USER appuser
|
11 |
|
12 |
+
# Copy the current directory contents into the container at /code
|
13 |
COPY ./requirements.txt /code/requirements.txt
|
14 |
+
# Install pip requirements
|
15 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
16 |
|
17 |
+
# Set home to the user's home directory
|
18 |
+
ENV HOME=/home/user
|
19 |
+
ENV PATH=/home/user/.local/bin:$PATH
|
20 |
+
|
21 |
+
# Set the working directory to the user's home directory
|
22 |
+
WORKDIR $HOME/app
|
23 |
+
|
24 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
25 |
+
COPY --chown=user . $HOME/app
|
26 |
|
27 |
# During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug
|
28 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|