Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +38 -0
Dockerfile
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.10
|
2 |
+
|
3 |
+
# Install fakeroot and set up user
|
4 |
+
RUN apt-get update && apt-get install -y fakeroot && \
|
5 |
+
mv /usr/bin/apt-get /usr/bin/.apt-get && \
|
6 |
+
echo '#!/usr/bin/env sh\nfakeroot /usr/bin/.apt-get $@' > /usr/bin/apt-get && \
|
7 |
+
chmod +x /usr/bin/apt-get && \
|
8 |
+
rm -rf /var/lib/apt/lists/* && \
|
9 |
+
useradd -m -u 1000 user
|
10 |
+
|
11 |
+
COPY --chown=1000:1000 --from=root / /
|
12 |
+
|
13 |
+
WORKDIR /home/user/app
|
14 |
+
|
15 |
+
# Install dependencies, replacing libgl1-mesa-glx with libgl1 and libglx-mesa0
|
16 |
+
RUN apt-get update && apt-get install -y \
|
17 |
+
git \
|
18 |
+
git-lfs \
|
19 |
+
ffmpeg \
|
20 |
+
libsm6 \
|
21 |
+
libxext6 \
|
22 |
+
cmake \
|
23 |
+
rsync \
|
24 |
+
libgl1 \
|
25 |
+
libglx-mesa0 \
|
26 |
+
&& rm -rf /var/lib/apt/lists/* \
|
27 |
+
&& git lfs install
|
28 |
+
|
29 |
+
# Copy application code
|
30 |
+
COPY --chown=1000:1000 ./app /home/user/app
|
31 |
+
|
32 |
+
# Install Python dependencies
|
33 |
+
COPY --chown=1000:1000 requirements.txt /home/user/app/
|
34 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
35 |
+
|
36 |
+
# Run the application
|
37 |
+
USER user
|
38 |
+
CMD ["python", "optimized_diet_plan_complete.py"]
|