pri
Browse files- Dockerfile +6 -1
Dockerfile
CHANGED
@@ -6,10 +6,15 @@ RUN python3 -m pip install fastapi pydantic loguru --break-system-packages
|
|
6 |
RUN python3 -m pip install requests python-multipart --break-system-packages
|
7 |
RUN python3 -m pip install uvicorn --break-system-packages
|
8 |
|
9 |
-
|
|
|
|
|
|
|
10 |
|
|
|
11 |
WORKDIR /docker_as_a_service
|
12 |
|
|
|
13 |
# ENTRYPOINT [ "python3", "docker_as_a_service.py" ]
|
14 |
ENTRYPOINT ["/bin/bash", "-c"]
|
15 |
CMD ["python3 docker_as_a_service.py"]
|
|
|
6 |
RUN python3 -m pip install requests python-multipart --break-system-packages
|
7 |
RUN python3 -m pip install uvicorn --break-system-packages
|
8 |
|
9 |
+
# 为了让user用户可以访问/root目录
|
10 |
+
RUN useradd -m -u 1000 user
|
11 |
+
RUN chown -R user:user /root
|
12 |
+
USER user
|
13 |
|
14 |
+
COPY ./docker_as_a_service /docker_as_a_service
|
15 |
WORKDIR /docker_as_a_service
|
16 |
|
17 |
+
|
18 |
# ENTRYPOINT [ "python3", "docker_as_a_service.py" ]
|
19 |
ENTRYPOINT ["/bin/bash", "-c"]
|
20 |
CMD ["python3 docker_as_a_service.py"]
|