Spaces:
Sleeping
Sleeping
port
Browse files- Dockerfile +7 -3
Dockerfile
CHANGED
@@ -1,6 +1,10 @@
|
|
1 |
# Use an official Python image as the base image
|
2 |
FROM python:3.8-slim
|
3 |
|
|
|
|
|
|
|
|
|
4 |
# Set the working directory inside the container
|
5 |
WORKDIR /app
|
6 |
|
@@ -15,10 +19,10 @@ RUN pip install torch torchvision
|
|
15 |
RUN pip install transformers librosa deep-translator python-multipart fastapi uvicorn
|
16 |
|
17 |
# Copy the main script
|
18 |
-
COPY main.py .
|
19 |
|
20 |
# Expose the port the app runs on
|
21 |
-
EXPOSE
|
22 |
|
23 |
# Set the default command to run your FastAPI app or any other server
|
24 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "
|
|
|
1 |
# Use an official Python image as the base image
|
2 |
FROM python:3.8-slim
|
3 |
|
4 |
+
RUN useradd -m -u 1000 user
|
5 |
+
USER user
|
6 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
7 |
+
|
8 |
# Set the working directory inside the container
|
9 |
WORKDIR /app
|
10 |
|
|
|
19 |
RUN pip install transformers librosa deep-translator python-multipart fastapi uvicorn
|
20 |
|
21 |
# Copy the main script
|
22 |
+
COPY --chown=user main.py .
|
23 |
|
24 |
# Expose the port the app runs on
|
25 |
+
EXPOSE 7860
|
26 |
|
27 |
# Set the default command to run your FastAPI app or any other server
|
28 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|