- FastAPI backend with news scraping from Yahoo Japan - SQLite database for article storage - Web UI with dark mode, article modal, statistics dashboard - Docker support for containerized deployment - API endpoints: /api/today, /api/news, /api/collect-news, /api/dates, /api/download-json - Auto-collect feature when requesting today news - Content filtering for articles without body text
1.5 KiB
1.5 KiB
Deployment Guide for Japan News Collector
This guide explains how to deploy the application using Docker on your home server or any machine with Docker installed.
Prerequisites
- Docker installed.
- Docker Compose installed (usually included with Docker Desktop/Docker Engine).
Files Overview
- Dockerfile: Defines the environment (Python 3.9) and dependencies.
- docker-compose.yml: Orchestrates the container, maps ports (8000), and persists data (
news.db).
Deployment Steps
- Transfer Files: Copy the entire project folder to your server.
- Navigate to Directory:
cd japan-news - Start the Service:
Run the following command to build and start the container in the background:
docker-compose up -d --build
Managing the Service
- Check Logs:
docker-compose logs -f - Stop the Service:
docker-compose down - Restart:
docker-compose restart
Data Persistence
The database file news.db is mapped to the container.
- Even if you stop or remove the container, your data in
news.dbon the host machine will remain safe. - Backup: Simply backup the
news.dbfile.
Accessing the Application
Open your browser and navigate to:
http://localhost:8000 (or your server's IP address: http://<server-ip>:8000)