diff --git a/Dockerfile b/Dockerfile index d063e25..bace02b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,11 +5,9 @@ FROM python:3.11-slim-bookworm ENV PYTHONUNBUFFERED=1 ENV PYTHONDONTWRITEBYTECODE=1 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 -RUN echo 'Acquire::http { Proxy "'"$APT_CACHER_NG"'/"; };' > /etc/apt/apt.conf.d/01proxy +# Add apt-cacher-ng configuration (if APT_CACHER_NG is set) +RUN if [ -n "$APT_CACHER_NG" ]; then echo 'Acquire::http { Proxy "'"$APT_CACHER_NG"'/"; };' > /etc/apt/apt.conf.d/01proxy; fi # Install system dependencies RUN apt-get update && apt-get install -y \ diff --git a/README-Docker.md b/README-Docker.md index 5d4fd79..219b584 100644 --- a/README-Docker.md +++ b/README-Docker.md @@ -58,7 +58,8 @@ This application is a Craigslist job scraper with a Flask web interface. ### Environment Variables - `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 @@ -309,6 +310,7 @@ services: # Optional configuration - GUNICORN_WORKERS=${GUNICORN_WORKERS:-4} + - APT_CACHER_NG=${APT_CACHER_NG} volumes: - type: bind source: ./cache diff --git a/README.md b/README.md index e1e427b..f458291 100644 --- a/README.md +++ b/README.md @@ -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` 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. diff --git a/docker-compose.yml b/docker-compose.yml index b2f48c6..41c117d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,6 +18,7 @@ services: # Optional configuration - GUNICORN_WORKERS=${GUNICORN_WORKERS:-4} + - APT_CACHER_NG=${APT_CACHER_NG} volumes: - type: bind source: ./cache