diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..d2ec1ca --- /dev/null +++ b/.env.example @@ -0,0 +1,7 @@ +# Optional: Pypes API integration +CLIENT_SECRET= +PYPES_BASE_URL=https://api.pypes.dev + +# Optional: AI provider for smart form filling +# AI_PROVIDER=openai +# AI_API_KEY=sk-... \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4bc98a1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM --platform=linux/amd64 python:3.11-slim + +# System deps for Chrome +RUN apt-get update && apt-get install -y \ + wget gnupg ca-certificates fonts-liberation \ + libasound2 libatk-bridge2.0-0 libatk1.0-0 libcups2 \ + libdbus-1-3 libgdk-pixbuf2.0-0 libnspr4 libnss3 \ + libx11-xcb1 libxcomposite1 libxdamage1 libxrandr2 \ + libxss1 libgbm1 xdg-utils --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* + +# Install Google Chrome +RUN wget -q -O /tmp/chrome.deb \ + https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \ + && apt-get update && apt-get install -y /tmp/chrome.deb \ + && rm /tmp/chrome.deb + +WORKDIR /app + +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +ENV PYTHONUNBUFFERED=1 +# Tell the app to run headless +ENV HIRINGFUNNEL_HEADLESS=1 + +# --run requires a profile name; users pass it via env or override CMD +CMD ["python", "hiringfunnel.py", "--run", "default", "--headless"] \ No newline at end of file diff --git a/README.md b/README.md index d4e9e85..caaf891 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,65 @@ python hiringfunnel.py pip install pytest .venv/bin/python -m pytest tests/ -v ``` +## Docker + +Run FoxyApply in a container with headless Chrome — no local browser or Python setup needed. + +### Prerequisites + +- [Docker](https://docs.docker.com/get-docker/) installed and running + +### Setup + +**1. Copy the example env file and fill in your credentials:** +```bash +cp .env.example .env +``` + +Edit `.env`: +```env +LINKEDIN_EMAIL=your@email.com +LINKEDIN_PASSWORD=yourpassword +``` + +**2. Create a profile** (first run, interactive): +```bash +docker build -t foxyapply . +docker run -it --env-file .env foxyapply python hiringfunnel.py +``` + +This launches the TUI so you can create and save a profile. Profiles are stored in `profiles.json`. + +**3. Run non-interactively** (after a profile is created): +```bash +docker run --env-file .env \ + -v $(pwd)/profiles.json:/app/profiles.json \ + -v $(pwd)/logs:/app/logs \ + foxyapply python hiringfunnel.py --run "your-profile-name" --headless +``` + +The `-v` flags persist your profiles and logs outside the container. + +### Docker Compose (recommended) +```bash +cp .env.example .env +# Fill in your credentials in .env + +docker compose up --build +``` + +To change which profile runs, edit `docker-compose.yml`: +```yaml +command: ["python", "hiringfunnel.py", "--run", "your-profile-name", "--headless"] +``` + +### Notes + +- Chrome runs in headless mode inside Docker — you won't see a browser window +- Logs are written to `./logs/hiringfunnel.log` +- If LinkedIn requires manual login verification, run interactively with `-it` and remove `--headless` + + ## License diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..bd0bcd1 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +version: "3.9" +services: + foxyapply: + build: . + env_file: + - .env + volumes: + - ./profiles.json:/app/profiles.json + - ./logs:/app/logs + command: ["python", "hiringfunnel.py", "--run", "default", "--headless"] + restart: unless-stopped \ No newline at end of file