3v324v23 commited on
Commit
66d6c79
·
1 Parent(s): 25ec0a8

Add verification for trade_date in database

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -4
Dockerfile CHANGED
@@ -40,14 +40,16 @@ COPY data/standard_trade_records_sample.csv ./data/
40
  # 创建SQLite数据库脚本
41
  COPY init_sqlite.py .
42
 
43
- # 删除旧数据库(如果存在)
44
- RUN rm -f data/customs_data.db
45
 
46
  # 初始化SQLite数据库
47
  RUN python init_sqlite.py
48
 
49
- # 验证数据库已创建
50
- RUN ls -lh data/customs_data.db && sqlite3 data/customs_data.db "SELECT COUNT(*) FROM standard_trade_records;"
 
 
51
 
52
  # 暴露端口
53
  EXPOSE 7860
 
40
  # 创建SQLite数据库脚本
41
  COPY init_sqlite.py .
42
 
43
+ # 删除旧数据库(如果存在)并确认
44
+ RUN rm -f data/customs_data.db && echo "Removed old database" && ls -la data/
45
 
46
  # 初始化SQLite数据库
47
  RUN python init_sqlite.py
48
 
49
+ # 验证数据库已创建并检查日期字段
50
+ RUN ls -lh data/customs_data.db && \
51
+ sqlite3 data/customs_data.db "SELECT COUNT(*) FROM standard_trade_records;" && \
52
+ sqlite3 data/customs_data.db "SELECT trade_date FROM standard_trade_records LIMIT 3;"
53
 
54
  # 暴露端口
55
  EXPOSE 7860