Joey889 commited on
Commit
bc44543
·
verified ·
1 Parent(s): 80adf46

Upload 4 files

Browse files
Files changed (4) hide show
  1. Dockerfile +18 -0
  2. README.md +15 -10
  3. app.py +1 -1
  4. requirements.txt +1 -0
Dockerfile ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 基礎映像:Python 3.9
2
+ FROM python:3.9-slim
3
+
4
+ # 設定工作目錄
5
+ WORKDIR /app
6
+
7
+ # 複製所需檔案
8
+ COPY requirements.txt .
9
+ COPY app.py .
10
+
11
+ # 安裝依賴
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
+
14
+ # 指定埠口
15
+ EXPOSE 5000
16
+
17
+ # 啟動應用
18
+ CMD ["python", "app.py"]
README.md CHANGED
@@ -1,10 +1,15 @@
1
- ---
2
- title: Scratch
3
- emoji: 🌖
4
- colorFrom: gray
5
- colorTo: indigo
6
- sdk: docker
7
- pinned: false
8
- ---
9
-
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
1
+ # Flask Command Server
2
+
3
+ 一個簡單的 Flask 應用,透過 `/set_command` 設定指令,並從 `/get_command` 取得目前指令。
4
+
5
+ ## API
6
+
7
+ ### POST /set_command
8
+ ```json
9
+ { "command": "your_command" }
10
+ ```
11
+
12
+ ### GET /get_command
13
+ ```json
14
+ { "command": "your_command" }
15
+ ```
app.py CHANGED
@@ -14,4 +14,4 @@ def get_command():
14
  return {"command": command}
15
 
16
  if __name__ == "__main__":
17
- app.run(host="0.0.0.0", port=5000)
 
14
  return {"command": command}
15
 
16
  if __name__ == "__main__":
17
+ app.run(host="0.0.0.0", port=5000)
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ flask