Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +6 -14
Dockerfile
CHANGED
|
@@ -1,26 +1,18 @@
|
|
| 1 |
# Use an official Python image as a base
|
| 2 |
-
FROM python:3.9
|
| 3 |
|
| 4 |
# Set the working directory to /app
|
| 5 |
-
WORKDIR /
|
| 6 |
|
| 7 |
# Copy the requirements file
|
| 8 |
-
COPY requirements.txt .
|
| 9 |
|
| 10 |
# Install the dependencies
|
| 11 |
-
RUN pip install -r
|
| 12 |
-
|
| 13 |
-
# Create a new user and set up the environment
|
| 14 |
-
RUN useradd -m -u 1000 user
|
| 15 |
-
USER user
|
| 16 |
-
ENV HOME=/home/user \
|
| 17 |
-
PATH=/home/user/.local/bin:$PATH
|
| 18 |
|
| 19 |
# Copy the application code
|
| 20 |
COPY . .
|
| 21 |
|
| 22 |
-
# Expose the port
|
| 23 |
-
EXPOSE 8000
|
| 24 |
-
|
| 25 |
# Run the command to start the development server
|
| 26 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "
|
|
|
|
| 1 |
# Use an official Python image as a base
|
| 2 |
+
FROM python:3.9
|
| 3 |
|
| 4 |
# Set the working directory to /app
|
| 5 |
+
WORKDIR /code
|
| 6 |
|
| 7 |
# Copy the requirements file
|
| 8 |
+
COPY ./requirements.txt /code/requirements.txt
|
| 9 |
|
| 10 |
# Install the dependencies
|
| 11 |
+
RUN pip install --no-cache-dir --upgrade -r /code/
|
| 12 |
+
requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
# Copy the application code
|
| 15 |
COPY . .
|
| 16 |
|
|
|
|
|
|
|
|
|
|
| 17 |
# Run the command to start the development server
|
| 18 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|