Spaces:
Sleeping
Sleeping
sarthaksavvy
commited on
Commit
·
4ac25fc
1
Parent(s):
86e11f0
[main] t1
Browse files- Dockerfile +10 -7
Dockerfile
CHANGED
|
@@ -1,20 +1,23 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
RUN useradd user
|
| 4 |
-
USER user
|
| 5 |
-
|
| 6 |
WORKDIR /app
|
| 7 |
|
| 8 |
-
RUN chown -R user:user /app
|
| 9 |
-
COPY --chown=user:user . /code
|
| 10 |
-
|
| 11 |
RUN pip install --upgrade pip
|
| 12 |
RUN pip install fastapi uvicorn transformers
|
| 13 |
RUN pip install h5py --only-binary h5py
|
| 14 |
RUN pip install tensorflow tf-keras torch torchvision
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 18 |
-
|
| 19 |
|
| 20 |
CMD fastapi run --reload --host=0.0.0.0 --port=7860
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
|
|
|
|
|
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
|
|
|
|
|
|
| 5 |
RUN pip install --upgrade pip
|
| 6 |
RUN pip install fastapi uvicorn transformers
|
| 7 |
RUN pip install h5py --only-binary h5py
|
| 8 |
RUN pip install tensorflow tf-keras torch torchvision
|
| 9 |
|
| 10 |
+
RUN useradd user
|
| 11 |
+
# Switch to the "user" user
|
| 12 |
+
USER user
|
| 13 |
+
|
| 14 |
+
# ENV HOME=/home/user \
|
| 15 |
+
# PATH=/home/user/.local/bin:$PATH
|
| 16 |
+
|
| 17 |
+
# Set the working directory to the user's home directory
|
| 18 |
+
# WORKDIR $HOME/app
|
| 19 |
|
| 20 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 21 |
+
COPY --chown=user . /app
|
| 22 |
|
| 23 |
CMD fastapi run --reload --host=0.0.0.0 --port=7860
|