Skip to content

Commit ac1b1ab

Browse files
committed
add docker
1 parent 07eea9e commit ac1b1ab

File tree

5 files changed

+85
-1
lines changed

5 files changed

+85
-1
lines changed

.dockerignore

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
__pycache__
2+
*.pyc
3+
*.pyo
4+
*.pyd
5+
.Python
6+
env
7+
pip-log.txt
8+
pip-delete-this-directory.txt
9+
.tox
10+
.coverage
11+
.coverage.*
12+
.cache
13+
nosetests.xml
14+
coverage.xml
15+
*.cover
16+
*.log
17+
.pytest_cache
18+
.env
19+
.venv
20+
venv
21+
ENV
22+
env.bak
23+
venv.bak
24+
.idea
25+
.vscode

Dockerfile

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# 使用官方 Python 映像作為基礎
2+
FROM python:3.9-slim
3+
4+
# 設置工作目錄
5+
WORKDIR /app
6+
7+
# 安裝系統依賴
8+
RUN apt-get update && apt-get install -y \
9+
python3-tk \
10+
&& rm -rf /var/lib/apt/lists/*
11+
12+
# 複製需要的文件
13+
COPY requirements.txt .
14+
COPY "Cash & Chill.py" .
15+
COPY screenshots/ ./screenshots/
16+
17+
# 安裝 Python 依賴
18+
RUN pip install --no-cache-dir -r requirements.txt
19+
20+
# 設置環境變數
21+
ENV DISPLAY=:0
22+
23+
# 運行應用
24+
CMD ["python", "Cash & Chill.py"]

README.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def show\_warning\_dialog() # 顯示警告對話框
9696

9797
### 📊 資料結構設計
9898

99-
#### 交易記錄結構
99+
#### 交易記錄��構
100100

101101
python
102102

@@ -159,3 +159,22 @@ scheduled\_event = {
159159
- **測試團隊** - [LIN, LI–SHIN & CHEN, MENG-YUN & HSIEH, CHING HUAI & CHEN,SHIH-TING]
160160

161161
<p align="center">Made with ❤️ in NTU</p>
162+
163+
## 🐳 Docker 部署
164+
165+
### 使用 Docker 運行
166+
167+
1. 確保已安裝 Docker 和 Docker Compose
168+
2. 克隆專案後,在專案根目錄執行:
169+
170+
#### 構建映像
171+
172+
docker-compose build
173+
174+
#### 運行容器
175+
176+
docker-compose up
177+
178+
#### 停止容器
179+
180+
docker-compose down

docker-compose.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: '3.8'
2+
3+
services:
4+
cash-and-chill:
5+
build: .
6+
container_name: cash-and-chill
7+
volumes:
8+
- /tmp/.X11-unix:/tmp/.X11-unix
9+
- ./data:/app/data
10+
environment:
11+
- DISPLAY=${DISPLAY}
12+
network_mode: host

requirements.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
tkinter>=8.6
2+
matplotlib>=3.5.0
3+
pandas>=1.3.0
4+
tkcalendar>=1.6.1

0 commit comments

Comments
 (0)