Update Dockerfile
Browse files- Dockerfile +14 -5
Dockerfile
CHANGED
@@ -1,10 +1,19 @@
|
|
1 |
FROM python:3.9
|
2 |
|
3 |
-
|
|
|
|
|
|
|
4 |
|
5 |
-
|
6 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
7 |
|
8 |
-
COPY . .
|
|
|
9 |
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
FROM python:3.9
|
2 |
|
3 |
+
RUN useradd -m -u 1000 user
|
4 |
+
USER user
|
5 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
6 |
+
ENV PYTHONUNBUFFERED=1
|
7 |
|
8 |
+
WORKDIR /code
|
|
|
9 |
|
10 |
+
COPY --chown=user ./requirements.txt /code/requirements.txt
|
11 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
12 |
|
13 |
+
COPY --chown=user . /code/
|
14 |
+
|
15 |
+
USER root
|
16 |
+
RUN chmod +x /code/start.sh
|
17 |
+
USER user
|
18 |
+
|
19 |
+
CMD ["/bin/bash", "/code/start.sh"]
|