Update Dockerfile
Browse files- Dockerfile +9 -7
Dockerfile
CHANGED
|
@@ -9,13 +9,15 @@ RUN apt-get update && apt-get install -y build-essential git && rm -rf /var/lib/
|
|
| 9 |
|
| 10 |
# Copy all project files into the working directory
|
| 11 |
COPY . .
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
-
|
| 14 |
-
RUN pip install --upgrade pip && \
|
| 15 |
-
pip install --no-cache-dir -r requirements.txt
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
| 21 |
-
CMD
|
|
|
|
| 9 |
|
| 10 |
# Copy all project files into the working directory
|
| 11 |
COPY . .
|
| 12 |
+
RUN useradd user
|
| 13 |
+
USER user
|
| 14 |
+
ENV HOME=/home/user \
|
| 15 |
+
PATH=/home/user/.local/bin:$PATH
|
| 16 |
|
| 17 |
+
WORKDIR $HOME/app
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
COPY --chown=user ./ $HOME/app
|
| 20 |
+
RUN pip install -r requirements.txt
|
| 21 |
|
| 22 |
+
|
| 23 |
+
CMD fastapi run --reload --host=0.0.0.0 --port=7860
|