Spaces:
Sleeping
Sleeping
jatin-tec
commited on
Commit
β’
03bdd77
1
Parent(s):
2bf11bd
trying
Browse files- Dockerfile +12 -5
- app.py β main.py +2 -1
Dockerfile
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
-
FROM python:3.
|
|
|
2 |
WORKDIR /code
|
3 |
|
4 |
-
|
5 |
|
6 |
RUN apt-get update && apt-get upgrade -y
|
7 |
|
@@ -10,16 +11,22 @@ RUN apt-get install -y build-essential cmake pkg-config \
|
|
10 |
&& apt-get install -y libx11-dev libatlas-base-dev \
|
11 |
&& apt-get install -y libgtk-3-dev libboost-python-dev
|
12 |
|
13 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
14 |
|
|
|
15 |
RUN useradd -m -u 1000 user
|
|
|
|
|
16 |
USER user
|
17 |
|
|
|
18 |
ENV HOME=/home/user \
|
19 |
-
|
20 |
|
|
|
21 |
WORKDIR $HOME/app
|
22 |
|
|
|
23 |
COPY --chown=user . $HOME/app
|
24 |
|
25 |
-
CMD ["
|
|
|
1 |
+
FROM python:3.9
|
2 |
+
|
3 |
WORKDIR /code
|
4 |
|
5 |
+
COPY ./requirements.txt /code/requirements.txt
|
6 |
|
7 |
RUN apt-get update && apt-get upgrade -y
|
8 |
|
|
|
11 |
&& apt-get install -y libx11-dev libatlas-base-dev \
|
12 |
&& apt-get install -y libgtk-3-dev libboost-python-dev
|
13 |
|
14 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
15 |
|
16 |
+
# Set up a new user named "user" with user ID 1000
|
17 |
RUN useradd -m -u 1000 user
|
18 |
+
|
19 |
+
# Switch to the "user" user
|
20 |
USER user
|
21 |
|
22 |
+
# Set home to the user's home directory
|
23 |
ENV HOME=/home/user \
|
24 |
+
PATH=/home/user/.local/bin:$PATH
|
25 |
|
26 |
+
# Set the working directory to the user's home directory
|
27 |
WORKDIR $HOME/app
|
28 |
|
29 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
30 |
COPY --chown=user . $HOME/app
|
31 |
|
32 |
+
CMD ["python", "main.py"]
|
app.py β main.py
RENAMED
@@ -72,4 +72,5 @@ with gr.Blocks() as demo:
|
|
72 |
|
73 |
submit.click(sentence_builder, inputs=[age, sex, skin_type, allergy, diet, img], outputs=[html_output, rc, lc, chin, fh])
|
74 |
|
75 |
-
|
|
|
|
72 |
|
73 |
submit.click(sentence_builder, inputs=[age, sex, skin_type, allergy, diet, img], outputs=[html_output, rc, lc, chin, fh])
|
74 |
|
75 |
+
if __name__ == "__main__":
|
76 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|