DB(sqlite + WAL) 제거. 모든 state를 단일 JSON 파일로 통합. 일회용/내부용이라 유지보수성/확장성보다 단순성 우선. 변경: - app.py: sqlite3 import 제거. load_data/save_data + threading.RLock + atomic write - votes: list of dict - titles, tie_breaks, settings: dict - people: roster (assign_teams가 채움) - 누락 키 자동 보강 - assign_teams.py: hackathon.json 단일 출력. 기존 votes/titles 보존 - Dockerfile/compose: votes.db volume 제거. hackathon.json read-write mount - tests/e2e.py: 12개 (12/12 통과). load/save/insert_vote/clear_votes/atomic 추가 - README: 새 데이터 구조 문서화 - roster.json/participants.json 제거 (hackathon.json으로 통합) 호스트 편집 워크플로: - jq/vi로 hackathon.json 직접 편집 - 앱 매 요청 reload — 컨테이너 재시작 불필요 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
25 lines
526 B
Docker
25 lines
526 B
Docker
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends tzdata && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
ENV TZ=Asia/Seoul
|
|
|
|
COPY requirements.txt ./
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY app.py assign_teams.py ./
|
|
COPY hackathon.json ./
|
|
|
|
EXPOSE 8501
|
|
|
|
ENV DATA_PATH=/app/hackathon.json
|
|
|
|
CMD ["streamlit", "run", "app.py", \
|
|
"--server.address=0.0.0.0", \
|
|
"--server.port=8501", \
|
|
"--server.headless=true", \
|
|
"--browser.gatherUsageStats=false"]
|