Test1hdhs718 commited on
Commit
a4998c6
·
1 Parent(s): 62eb5a2

Add dockerfile

Browse files
Files changed (2) hide show
  1. .gitignore +0 -5
  2. Dockerfile +20 -0
.gitignore CHANGED
@@ -21,8 +21,3 @@ db.sqlite3
21
  # IDE files
22
  .vscode/
23
  .idea/
24
-
25
- # Ignore Docker-related files (if you are using Docker)
26
- Dockerfile
27
- docker-compose.yml
28
- .dockerignore
 
21
  # IDE files
22
  .vscode/
23
  .idea/
 
 
 
 
 
Dockerfile ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Sử dụng một hình ảnh cơ bản Python
2
+ FROM python:3.8-slim
3
+
4
+ # Thiết lập thư mục làm việc
5
+ WORKDIR /app
6
+
7
+ # Sao chép file requirements.txt vào thư mục làm việc
8
+ COPY requirements.txt .
9
+
10
+ # Cài đặt các dependencies
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
+
13
+ # Sao chép toàn bộ mã nguồn vào thư mục làm việc
14
+ COPY . .
15
+
16
+ # Mở cổng 8000, nơi FastAPI sẽ chạy
17
+ EXPOSE 8000
18
+
19
+ # Khởi chạy ứng dụng bằng uvicorn khi container được khởi động
20
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]