fix: update Dockerfile and documentation for APT_CACHER_NG configuration
This commit is contained in:
@@ -5,11 +5,9 @@ FROM python:3.11-slim-bookworm
|
|||||||
ENV PYTHONUNBUFFERED=1
|
ENV PYTHONUNBUFFERED=1
|
||||||
ENV PYTHONDONTWRITEBYTECODE=1
|
ENV PYTHONDONTWRITEBYTECODE=1
|
||||||
ENV FLASK_ENV=production
|
ENV FLASK_ENV=production
|
||||||
ENV FLASK_SECRET=production-secret-change-me
|
|
||||||
ENV APT_CACHER_NG=http://192.168.88.14:3142
|
|
||||||
|
|
||||||
# Add apt-cacher-ng configuration
|
# Add apt-cacher-ng configuration (if APT_CACHER_NG is set)
|
||||||
RUN echo 'Acquire::http { Proxy "'"$APT_CACHER_NG"'/"; };' > /etc/apt/apt.conf.d/01proxy
|
RUN if [ -n "$APT_CACHER_NG" ]; then echo 'Acquire::http { Proxy "'"$APT_CACHER_NG"'/"; };' > /etc/apt/apt.conf.d/01proxy; fi
|
||||||
|
|
||||||
# Install system dependencies
|
# Install system dependencies
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
|
|||||||
@@ -58,7 +58,8 @@ This application is a Craigslist job scraper with a Flask web interface.
|
|||||||
### Environment Variables
|
### Environment Variables
|
||||||
|
|
||||||
- `FLASK_ENV`: Set to `production`
|
- `FLASK_ENV`: Set to `production`
|
||||||
- `FLASK_SECRET`: Secret key for Flask sessions
|
- `FLASK_SECRET`: Secret key for Flask sessions (required)
|
||||||
|
- `APT_CACHER_NG`: Optional URL for apt-cacher-ng proxy to speed up package downloads (e.g., `http://192.168.88.14:3142`)
|
||||||
|
|
||||||
### Database Configuration
|
### Database Configuration
|
||||||
|
|
||||||
@@ -309,6 +310,7 @@ services:
|
|||||||
|
|
||||||
# Optional configuration
|
# Optional configuration
|
||||||
- GUNICORN_WORKERS=${GUNICORN_WORKERS:-4}
|
- GUNICORN_WORKERS=${GUNICORN_WORKERS:-4}
|
||||||
|
- APT_CACHER_NG=${APT_CACHER_NG}
|
||||||
volumes:
|
volumes:
|
||||||
- type: bind
|
- type: bind
|
||||||
source: ./cache
|
source: ./cache
|
||||||
|
|||||||
@@ -39,3 +39,7 @@ The application includes an automated scheduler that runs the job scraping proce
|
|||||||
- **Testing**: Comprehensive test suite in `tests/test_scheduler.py`
|
- **Testing**: Comprehensive test suite in `tests/test_scheduler.py`
|
||||||
|
|
||||||
To modify the scheduling interval, edit the `start_scheduler()` function in `web/craigslist.py`.
|
To modify the scheduling interval, edit the `start_scheduler()` function in `web/craigslist.py`.
|
||||||
|
|
||||||
|
## Docker Deployment
|
||||||
|
|
||||||
|
Please see [README-Docker.md](README-Docker.md) for instructions on deploying the application using Docker.
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ services:
|
|||||||
|
|
||||||
# Optional configuration
|
# Optional configuration
|
||||||
- GUNICORN_WORKERS=${GUNICORN_WORKERS:-4}
|
- GUNICORN_WORKERS=${GUNICORN_WORKERS:-4}
|
||||||
|
- APT_CACHER_NG=${APT_CACHER_NG}
|
||||||
volumes:
|
volumes:
|
||||||
- type: bind
|
- type: bind
|
||||||
source: ./cache
|
source: ./cache
|
||||||
|
|||||||
Reference in New Issue
Block a user