Archit Sharma commited on
Commit
a333284
·
unverified ·
1 Parent(s): 4377399

update dockerfile build

Browse files

Signed-off-by: Archit Sharma <archit@pm.me>

.dockerignore ADDED
@@ -0,0 +1 @@
 
 
1
+ old
Dockerfile CHANGED
@@ -1,13 +1,35 @@
1
- FROM python:3.9
 
2
 
3
- WORKDIR /code
4
 
5
- COPY ./requirements.txt /code/requirements.txt
6
 
7
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
8
 
9
  COPY . .
10
 
11
- #CMD ["streamlit", "run", "app/main.py", "--server.enableCORS", "false", "--server.port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  CMD ["streamlit", "run", "app/main.py", "--server.port", "7860"]
13
 
 
1
+ # Build stage
2
+ FROM python:3.11 as builder
3
 
4
+ WORKDIR /build
5
 
6
+ COPY requirements.txt .
7
 
8
+ # Install dependencies
9
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
10
 
11
  COPY . .
12
 
13
+ # Build your application, if needed
14
+ # RUN python build.py
15
+
16
+ # Final stage
17
+ FROM python:3.11-slim-buster
18
+
19
+ COPY --from=builder /build /app
20
+
21
+ WORKDIR /app
22
+
23
+ # Copy installed dependencies from the builder stage
24
+ COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
25
+
26
+ # Copy the Streamlit executable
27
+ COPY --from=builder /usr/local/bin/streamlit /usr/local/bin/streamlit
28
+
29
+ # Expose the desired port
30
+ EXPOSE 7860
31
+
32
+ # Set the appropriate command to run Streamlit
33
+ # CMD ["streamlit", "run", "app/main.py", "--server.enableCORS", "false", "--server.port", "7860"]
34
  CMD ["streamlit", "run", "app/main.py", "--server.port", "7860"]
35
 
README.md CHANGED
@@ -9,3 +9,14 @@ license: other
9
  ---
10
 
11
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
9
  ---
10
 
11
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
12
+
13
+
14
+ ## Linked
15
+
16
+ ```
17
+ docker build -t siege-hugging-face
18
+ docker run -p 7860:7860 siege-hugging-face
19
+ ```
20
+
21
+ Goto http://localhost:7860/
22
+
Dockerfile.old → old/Dockerfile.old RENAMED
File without changes
old/requirements.txt ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ altair==4.2.2
2
+ attrs==23.1.0
3
+ blinker==1.6.2
4
+ cachetools==5.3.0
5
+ certifi==2023.5.7
6
+ charset-normalizer==3.1.0
7
+ click==8.1.3
8
+ decorator==5.1.1
9
+ entrypoints==0.4
10
+ gitdb==4.0.10
11
+ GitPython==3.1.31
12
+ h11==0.14.0
13
+ idna==3.4
14
+ importlib-metadata==6.6.0
15
+ Jinja2==3.1.2
16
+ jsonschema==4.17.3
17
+ markdown-it-py==2.2.0
18
+ MarkupSafe==2.1.2
19
+ mdurl==0.1.2
20
+ numpy==1.24.3
21
+ packaging==23.1
22
+ pandas==2.0.1
23
+ Pillow==9.5.0
24
+ protobuf==3.20.3
25
+ pyarrow==12.0.0
26
+ pydeck==0.8.1b0
27
+ Pygments==2.15.1
28
+ Pympler==1.0.1
29
+ pyrsistent==0.19.3
30
+ python-dateutil==2.8.2
31
+ pytz==2023.3
32
+ pytz-deprecation-shim==0.1.0.post0
33
+ requests==2.30.0
34
+ rich==13.3.5
35
+ six==1.16.0
36
+ smmap==5.0.0
37
+ streamlit==1.22.0
38
+ tenacity==8.2.2
39
+ toml==0.10.2
40
+ toolz==0.12.0
41
+ tornado==6.3.1
42
+ typing_extensions==4.5.0
43
+ tzdata==2023.3
44
+ tzlocal==4.3
45
+ urllib3==2.0.2
46
+ uvicorn==0.22.0
47
+ validators==0.20.0
48
+ zipp==3.15.0
requirements.txt CHANGED
@@ -1,48 +1 @@
1
- altair==4.2.2
2
- attrs==23.1.0
3
- blinker==1.6.2
4
- cachetools==5.3.0
5
- certifi==2023.5.7
6
- charset-normalizer==3.1.0
7
- click==8.1.3
8
- decorator==5.1.1
9
- entrypoints==0.4
10
- gitdb==4.0.10
11
- GitPython==3.1.31
12
- h11==0.14.0
13
- idna==3.4
14
- importlib-metadata==6.6.0
15
- Jinja2==3.1.2
16
- jsonschema==4.17.3
17
- markdown-it-py==2.2.0
18
- MarkupSafe==2.1.2
19
- mdurl==0.1.2
20
- numpy==1.24.3
21
- packaging==23.1
22
- pandas==2.0.1
23
- Pillow==9.5.0
24
- protobuf==3.20.3
25
- pyarrow==12.0.0
26
- pydeck==0.8.1b0
27
- Pygments==2.15.1
28
- Pympler==1.0.1
29
- pyrsistent==0.19.3
30
- python-dateutil==2.8.2
31
- pytz==2023.3
32
- pytz-deprecation-shim==0.1.0.post0
33
- requests==2.30.0
34
- rich==13.3.5
35
- six==1.16.0
36
- smmap==5.0.0
37
  streamlit==1.22.0
38
- tenacity==8.2.2
39
- toml==0.10.2
40
- toolz==0.12.0
41
- tornado==6.3.1
42
- typing_extensions==4.5.0
43
- tzdata==2023.3
44
- tzlocal==4.3
45
- urllib3==2.0.2
46
- uvicorn==0.22.0
47
- validators==0.20.0
48
- zipp==3.15.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  streamlit==1.22.0