Spaces:
Sleeping
Sleeping
Commit
·
98faae5
1
Parent(s):
24728c9
first commit
Browse files- Dockerfile +10 -1
Dockerfile
CHANGED
@@ -1,6 +1,9 @@
|
|
1 |
# Use the official Python image from the Docker Hub
|
2 |
FROM python:3.12-slim
|
3 |
|
|
|
|
|
|
|
4 |
# Set the working directory in the container
|
5 |
WORKDIR /app
|
6 |
|
@@ -13,6 +16,12 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
13 |
# Copy the rest of the application code into the container at /app
|
14 |
COPY . .
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
# Expose the port that the app runs on
|
17 |
EXPOSE 7860
|
18 |
|
@@ -20,4 +29,4 @@ EXPOSE 7860
|
|
20 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
21 |
|
22 |
# docker run -d --rm --name "pdfsummary" -e dgoogle_api_key=AIzaSyARfxSKQwobd0MNuOAt6yUjmNUFGX4k_eI -e google_api_key=AIzaSyARfxSKQwobd0MNuOAt6yUjmNUFGX4k_eI -p 8000:8000 cvscreening:latest
|
23 |
-
# docker run -d --rm -p
|
|
|
1 |
# Use the official Python image from the Docker Hub
|
2 |
FROM python:3.12-slim
|
3 |
|
4 |
+
# Create a new user
|
5 |
+
RUN adduser --disabled-password --gecos '' myuser
|
6 |
+
|
7 |
# Set the working directory in the container
|
8 |
WORKDIR /app
|
9 |
|
|
|
16 |
# Copy the rest of the application code into the container at /app
|
17 |
COPY . .
|
18 |
|
19 |
+
# Change ownership of the app directory to the new user
|
20 |
+
RUN chown -R myuser:myuser /app
|
21 |
+
|
22 |
+
# Switch to the new user
|
23 |
+
USER myuser
|
24 |
+
|
25 |
# Expose the port that the app runs on
|
26 |
EXPOSE 7860
|
27 |
|
|
|
29 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
30 |
|
31 |
# docker run -d --rm --name "pdfsummary" -e dgoogle_api_key=AIzaSyARfxSKQwobd0MNuOAt6yUjmNUFGX4k_eI -e google_api_key=AIzaSyARfxSKQwobd0MNuOAt6yUjmNUFGX4k_eI -p 8000:8000 cvscreening:latest
|
32 |
+
# docker run -d --rm -p
|