Spaces:
Sleeping
Sleeping
shethjenil
commited on
Commit
•
76dbc01
1
Parent(s):
2a0c85c
Upload Dockerfile
Browse files- Dockerfile +27 -0
Dockerfile
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.9
|
2 |
+
|
3 |
+
# Create a non-root user
|
4 |
+
RUN useradd -ms /bin/bash myuser
|
5 |
+
|
6 |
+
WORKDIR /code
|
7 |
+
|
8 |
+
# Copy required files
|
9 |
+
COPY ./requirements.txt /code/requirements.txt
|
10 |
+
|
11 |
+
# Install dependencies
|
12 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
13 |
+
|
14 |
+
# Change ownership of the directory
|
15 |
+
RUN chown -R myuser:myuser /code
|
16 |
+
|
17 |
+
# Switch to the non-root user
|
18 |
+
USER myuser
|
19 |
+
|
20 |
+
# Extract the contents of the zip file
|
21 |
+
RUN unzip /code/jainbook.zip -d /code/jainbook
|
22 |
+
|
23 |
+
# Copy remaining application files
|
24 |
+
COPY . .
|
25 |
+
|
26 |
+
# Set the startup command
|
27 |
+
CMD ["python", "app.py"]
|