Spaces:
Sleeping
Sleeping
check
Browse files- Dockerfile +23 -13
Dockerfile
CHANGED
@@ -1,24 +1,34 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
# Set up a new user named "user" with user ID 1000
|
4 |
-
RUN pwd
|
5 |
-
RUN useradd -m -u 1000 user
|
6 |
|
7 |
-
# Switch to the "user" user
|
8 |
-
USER user
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
WORKDIR /app
|
12 |
-
RUN pwd
|
13 |
|
14 |
-
COPY
|
15 |
|
16 |
RUN pip install -r requirements.txt
|
17 |
|
18 |
EXPOSE 7860
|
19 |
|
20 |
-
COPY
|
21 |
-
# RUN mkdir -p ./.cache
|
22 |
-
# RUN chmod 777 ./.cache
|
23 |
|
24 |
CMD ["uvicorn", "src.main_sentiment:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
+
# # Set up a new user named "user" with user ID 1000
|
2 |
+
# RUN useradd -m -u 1000 user
|
|
|
|
|
|
|
3 |
|
4 |
+
# # Switch to the "user" user
|
5 |
+
# USER user
|
6 |
+
|
7 |
+
# # Set home to the user's home directory
|
8 |
+
# ENV HOME=/home/user \
|
9 |
+
# PATH=/home/user/.local/bin:$PATH
|
10 |
+
|
11 |
+
# # Set the working directory to the user's home directory
|
12 |
+
# WORKDIR $HOME/app
|
13 |
+
|
14 |
+
# # Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
|
15 |
+
# RUN pip install --no-cache-dir --upgrade pip
|
16 |
+
|
17 |
+
# # Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
18 |
+
# COPY --chown=user . $HOME/app
|
19 |
+
|
20 |
+
# # Download a checkpoint
|
21 |
+
# RUN mkdir content
|
22 |
+
# ADD --chown=user https://<SOME_ASSET_URL> content/<SOME_ASSET_NAME>
|
23 |
|
24 |
WORKDIR /app
|
|
|
25 |
|
26 |
+
COPY requirements.txt ./
|
27 |
|
28 |
RUN pip install -r requirements.txt
|
29 |
|
30 |
EXPOSE 7860
|
31 |
|
32 |
+
COPY . .
|
|
|
|
|
33 |
|
34 |
CMD ["uvicorn", "src.main_sentiment:app", "--host", "0.0.0.0", "--port", "7860"]
|