Upload Dockerfile
Browse files- Dockerfile +4 -12
Dockerfile
CHANGED
|
@@ -1,22 +1,14 @@
|
|
| 1 |
# Get the image of python
|
| 2 |
FROM python:3.9
|
| 3 |
|
| 4 |
-
RUN useradd -m -u 1000 user
|
| 5 |
-
USER user
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
# Set the current directory as working dir
|
| 9 |
-
WORKDIR /code
|
| 10 |
-
|
| 11 |
# Copy all the files from local-dir to machine dir
|
| 12 |
-
COPY
|
| 13 |
|
| 14 |
-
|
|
|
|
| 15 |
|
| 16 |
# Install the requirements
|
| 17 |
-
RUN pip install --no-cache-dir
|
| 18 |
-
|
| 19 |
-
COPY --chown=user:user . /code
|
| 20 |
|
| 21 |
# Launch the server
|
| 22 |
CMD ["uvicorn", "backend:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
# Get the image of python
|
| 2 |
FROM python:3.9
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
# Copy all the files from local-dir to machine dir
|
| 5 |
+
COPY . .
|
| 6 |
|
| 7 |
+
# Set the current directory as working dir
|
| 8 |
+
WORKDIR /
|
| 9 |
|
| 10 |
# Install the requirements
|
| 11 |
+
RUN pip install --no-cache-dir -r ./requirements.txt
|
|
|
|
|
|
|
| 12 |
|
| 13 |
# Launch the server
|
| 14 |
CMD ["uvicorn", "backend:app", "--host", "0.0.0.0", "--port", "7860"]
|