datnguyentien204 commited on
Commit
1600976
·
verified ·
1 Parent(s): 380e787

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +98 -98
Dockerfile CHANGED
@@ -1,98 +1,98 @@
1
- FROM python:3.10.13-slim
2
-
3
- # Đặt thư mục làm việc
4
- WORKDIR /app
5
-
6
- # Cài đặt các thư viện hệ thống cần thiết
7
- RUN apt-get update && apt-get install -y --no-install-recommends \
8
- ffmpeg libsm6 libxext6 \
9
- && rm -rf /var/lib/apt/lists/*
10
-
11
- # Cài đặt các gói Python trực tiếp
12
- RUN pip install --no-cache-dir \
13
- absl-py==2.1.0 \
14
- aiofiles==23.2.1 \
15
- altair==4.2.2 \
16
- annotated-types==0.7.0 \
17
- anyio==4.6.2.post1 \
18
- astunparse==1.6.3 \
19
- attrs==24.2.0 \
20
- blinker==1.9.0 \
21
- cachetools==5.5.0 \
22
- certifi==2024.8.30 \
23
- charset-normalizer==3.4.0 \
24
- click==8.1.7 \
25
- colorama==0.4.6 \
26
- entrypoints==0.4 \
27
- exceptiongroup==1.2.2 \
28
- fastapi==0.115.5 \
29
- ffmpy==0.4.0 \
30
- filelock==3.16.1 \
31
- flatbuffers==24.3.25 \
32
- fsspec==2024.10.0 \
33
- gast==0.4.0 \
34
- gitdb==4.0.11 \
35
- GitPython==3.1.43 \
36
- google-auth==2.36.0 \
37
- google-auth-oauthlib==0.4.6 \
38
- google-pasta==0.2.0 \
39
- gradio==5.7.1 \
40
- gradio_client==1.5.0 \
41
- grpcio==1.68.0 \
42
- h11==0.14.0 \
43
- h5py==3.12.1 \
44
- httpcore==1.0.7 \
45
- httpx==0.28.0 \
46
- huggingface-hub==0.26.3 \
47
- idna==3.10 \
48
- importlib_metadata==8.5.0 \
49
- Jinja2==3.1.4 \
50
- joblib==1.4.2 \
51
- jsonschema==4.23.0 \
52
- jsonschema-specifications==2024.10.1 \
53
- keras==2.10.0 \
54
- Keras-Preprocessing==1.1.2 \
55
- libclang==18.1.1 \
56
- Markdown==3.7 \
57
- markdown-it-py==3.0.0 \
58
- MarkupSafe==2.1.5 \
59
- mdurl==0.1.2 \
60
- ml-dtypes==0.4.1 \
61
- namex==0.0.8 \
62
- narwhals==1.14.3 \
63
- numpy==1.26.4 \
64
- oauthlib==3.2.2 \
65
- opt_einsum==3.4.0 \
66
- optree==0.13.1 \
67
- orjson==3.10.12 \
68
- packaging==24.2 \
69
- pandas==2.2.3 \
70
- pillow==11.0.0 \
71
- pip==24.2 \
72
- protobuf==3.19.6 \
73
- pyarrow==18.1.0 \
74
- pyasn1==0.6.1 \
75
- pyasn1_modules==0.4.1 \
76
- pydantic==2.10.2 \
77
- pydantic_core==2.27.1 \
78
- pydeck==0.9.1 \
79
- pydub==0.25.1
80
-
81
- # Thêm user không phải root để chạy ứng dụng an toàn hơn
82
- RUN useradd -m -u 1000 user
83
- USER user
84
- ENV HOME /home/user
85
- ENV PATH $HOME/.local/bin:$PATH
86
-
87
- # Thiết lập thư mục làm việc cho user
88
- WORKDIR $HOME/app
89
- COPY . $HOME/app
90
-
91
- # Expose port và chạy ứng dụng
92
- EXPOSE 7860
93
- CMD streamlit run app.py \
94
- --server.headless true \
95
- --server.port 7860 \
96
- --server.enableCORS false \
97
- --server.enableXsrfProtection false \
98
- --server.fileWatcherType none
 
1
+ FROM python:3.10.13-slim
2
+
3
+ # Đặt thư mục làm việc
4
+ WORKDIR /app
5
+
6
+ # Cài đặt các thư viện hệ thống cần thiết
7
+ RUN apt-get update && apt-get install -y --no-install-recommends \
8
+ ffmpeg libsm6 libxext6 \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # Cài đặt các gói Python trực tiếp
12
+ RUN pip install
13
+ absl-py==2.1.0 \
14
+ aiofiles==23.2.1 \
15
+ altair==4.2.2 \
16
+ annotated-types==0.7.0 \
17
+ anyio==4.6.2.post1 \
18
+ astunparse==1.6.3 \
19
+ attrs==24.2.0 \
20
+ blinker==1.9.0 \
21
+ cachetools==5.5.0 \
22
+ certifi==2024.8.30 \
23
+ charset-normalizer==3.4.0 \
24
+ click==8.1.7 \
25
+ colorama==0.4.6 \
26
+ entrypoints==0.4 \
27
+ exceptiongroup==1.2.2 \
28
+ fastapi==0.115.5 \
29
+ ffmpy==0.4.0 \
30
+ filelock==3.16.1 \
31
+ flatbuffers==24.3.25 \
32
+ fsspec==2024.10.0 \
33
+ gast==0.4.0 \
34
+ gitdb==4.0.11 \
35
+ GitPython==3.1.43 \
36
+ google-auth==2.36.0 \
37
+ google-auth-oauthlib==0.4.6 \
38
+ google-pasta==0.2.0 \
39
+ gradio==5.7.1 \
40
+ gradio_client==1.5.0 \
41
+ grpcio==1.68.0 \
42
+ h11==0.14.0 \
43
+ h5py==3.12.1 \
44
+ httpcore==1.0.7 \
45
+ httpx==0.28.0 \
46
+ huggingface-hub==0.26.3 \
47
+ idna==3.10 \
48
+ importlib_metadata==8.5.0 \
49
+ Jinja2==3.1.4 \
50
+ joblib==1.4.2 \
51
+ jsonschema==4.23.0 \
52
+ jsonschema-specifications==2024.10.1 \
53
+ keras==2.10.0 \
54
+ Keras-Preprocessing==1.1.2 \
55
+ libclang==18.1.1 \
56
+ Markdown==3.7 \
57
+ markdown-it-py==3.0.0 \
58
+ MarkupSafe==2.1.5 \
59
+ mdurl==0.1.2 \
60
+ ml-dtypes==0.4.1 \
61
+ namex==0.0.8 \
62
+ narwhals==1.14.3 \
63
+ numpy==1.26.4 \
64
+ oauthlib==3.2.2 \
65
+ opt_einsum==3.4.0 \
66
+ optree==0.13.1 \
67
+ orjson==3.10.12 \
68
+ packaging==24.2 \
69
+ pandas==2.2.3 \
70
+ pillow==11.0.0 \
71
+ pip==24.2 \
72
+ protobuf==3.19.6 \
73
+ pyarrow==18.1.0 \
74
+ pyasn1==0.6.1 \
75
+ pyasn1_modules==0.4.1 \
76
+ pydantic==2.10.2 \
77
+ pydantic_core==2.27.1 \
78
+ pydeck==0.9.1 \
79
+ pydub==0.25.1
80
+
81
+ # Thêm user không phải root để chạy ứng dụng an toàn hơn
82
+ RUN useradd -m -u 1000 user
83
+ USER user
84
+ ENV HOME /home/user
85
+ ENV PATH $HOME/.local/bin:$PATH
86
+
87
+ # Thiết lập thư mục làm việc cho user
88
+ WORKDIR $HOME/app
89
+ COPY . $HOME/app
90
+
91
+ # Expose port và chạy ứng dụng
92
+ EXPOSE 7860
93
+ CMD streamlit run app.py \
94
+ --server.headless true \
95
+ --server.port 7860 \
96
+ --server.enableCORS false \
97
+ --server.enableXsrfProtection false \
98
+ --server.fileWatcherType none