Spaces:
Runtime error
Runtime error
Commit
·
9eee3d5
1
Parent(s):
47031d7
Fixing dockerfile v1
Browse files- Dockerfile +9 -13
Dockerfile
CHANGED
@@ -1,24 +1,20 @@
|
|
1 |
# Use Python 3.12 slim image as base
|
2 |
FROM python:3.12-slim
|
3 |
|
4 |
-
# Set working directory
|
5 |
-
WORKDIR /app
|
6 |
|
7 |
-
|
8 |
-
|
|
|
9 |
|
10 |
-
|
11 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
|
13 |
-
|
14 |
-
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
ENV PYTHONUNBUFFERED=1
|
19 |
|
20 |
-
|
21 |
-
EXPOSE 7680
|
22 |
|
23 |
# Command to run the application
|
24 |
CMD ["python", "-m", "app.main"]
|
|
|
1 |
# Use Python 3.12 slim image as base
|
2 |
FROM python:3.12-slim
|
3 |
|
|
|
|
|
4 |
|
5 |
+
RUN useradd -m -u 1000 user
|
6 |
+
USER user
|
7 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
8 |
|
9 |
+
WORKDIR /app
|
|
|
10 |
|
11 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
12 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
13 |
|
14 |
+
COPY --chown=user . /app
|
15 |
+
COPY --chown=user main/ /app/main
|
|
|
16 |
|
17 |
+
EXPOSE 7860
|
|
|
18 |
|
19 |
# Command to run the application
|
20 |
CMD ["python", "-m", "app.main"]
|