-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
48 lines (46 loc) · 2.16 KB
/
Copy pathdocker-compose.yml
File metadata and controls
48 lines (46 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Layover weekly flight-email digest — self-contained, always-on.
#
# Runs a long-lived container that schedules itself (Mondays 07:00 by default),
# pulls new mail incrementally, parses candidate flights, dedups against AirTrail,
# and prints a digest to the logs. It NEVER writes to AirTrail (writes stay manual:
# `docker compose exec layover python3 populate.py /data --commit`).
#
# Setup:
# cp .env.example .env # AirTrail URL + API key, timezone, schedule
# chmod 600 .env accounts.ini # both hold secrets — git-ignored
# docker compose up -d --build
# docker compose logs -f layover # watch the digest
#
# Networking: default bridge (least privilege — the app only needs outbound IMAP
# 993 and one call to AirTrail). AirTrail is reached by name via extra_hosts:
# ${AIRTRAIL_HOST} resolves to the Docker host's gateway, so when AirTrail runs on
# the SAME host the container reaches it on :3006. Keep AIRTRAIL_HOST equal to the
# hostname in AirTrail's ORIGIN (e.g. its tailnet MagicDNS name) so the Host header
# matches and CSRF/ORIGIN checks pass. If AirTrail runs on a DIFFERENT machine, map
# that name to its reachable (tailnet) IP instead of host-gateway. See the README.
services:
layover:
build: .
image: layover:local
container_name: layover
init: true
restart: unless-stopped
extra_hosts:
- "${AIRTRAIL_HOST:-airtrail-host}:host-gateway"
env_file: .env
environment:
TZ: ${TZ:-Europe/Berlin}
SCHEDULE_MODE: ${SCHEDULE_MODE:-weekly} # weekly | interval
SCAN_INTERVAL_MINUTES: ${SCAN_INTERVAL_MINUTES:-30} # interval mode
SCHEDULE_DOW: ${SCHEDULE_DOW:-0} # 0=Mon .. 6=Sun (weekly)
SCHEDULE_HOUR: ${SCHEDULE_HOUR:-7}
SCHEDULE_MINUTE: ${SCHEDULE_MINUTE:-0}
RUN_ON_START: ${RUN_ON_START:-true}
LAYOVER_OUT: /data
# WEBHOOK_URL, NOTIFY_CMD and AUTO_WRITE (all optional) are passed through
# from .env via env_file above — set them there.
volumes:
- ./accounts.ini:/app/accounts.ini:ro # mailbox passwords (git-ignored)
- layover-data:/data # persists state.json + candidates.json
volumes:
layover-data: