Skip to content

Commit 7141fd0

Browse files
committed
feat: dockerize it
1 parent 7fe273d commit 7141fd0

File tree

5 files changed

+86
-1
lines changed

5 files changed

+86
-1
lines changed

.dockerignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Secrets and local data
2+
.env
3+
data/
4+
session/
5+
6+
# Python
7+
__pycache__/
8+
*.py[cod]
9+
*$py.class
10+
*.egg-info/
11+
dist/
12+
build/
13+
.eggs/
14+
15+
# Git
16+
.git/
17+
.gitignore
18+
19+
# IDE
20+
.idea/
21+
.vscode/
22+
*.swp
23+
24+
# OS
25+
.DS_Store
26+
27+
# Development
28+
.claude/

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
*.pem
44
*.key
55

6-
# Database
6+
# Database and session
77
data/
8+
session/
89
*.db
910

1011
# Python

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM python:3.11-slim
2+
3+
WORKDIR /app
4+
5+
# Install dependencies first for better caching
6+
COPY pyproject.toml README.md ./
7+
COPY src/ ./src/
8+
COPY templates/ ./templates/
9+
10+
RUN pip install --no-cache-dir -e .
11+
12+
# Session cookies and database will be mounted at runtime
13+
VOLUME ["/root/.find-my-timeline", "/app/data"]
14+
15+
EXPOSE 5000
16+
17+
CMD ["find-my-timeline", "start"]

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,29 @@ Set in `.env` or pass as CLI options:
4848
- `POLL_MAX_INTERVAL` - Maximum poll interval in minutes (default: 10)
4949
- `DATABASE_PATH` - SQLite database path (default: ./data/locations.db)
5050
- `WEB_HOST` / `WEB_PORT` - Web server binding (default: 127.0.0.1:5000)
51+
52+
## Docker
53+
54+
### First-time setup (interactive 2FA required)
55+
56+
```bash
57+
cp .env.example .env
58+
# Edit .env with your Apple ID
59+
60+
mkdir -p session data
61+
docker compose run --rm find-my-timeline find-my-timeline auth
62+
# Enter 2FA code when prompted
63+
```
64+
65+
### Run
66+
67+
```bash
68+
docker compose up -d
69+
# Open http://localhost:5000
70+
```
71+
72+
### Re-authenticate (when session expires, ~90 days)
73+
74+
```bash
75+
docker compose run --rm find-my-timeline find-my-timeline auth
76+
```

docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
services:
2+
find-my-timeline:
3+
build: .
4+
ports:
5+
- "5000:5000"
6+
volumes:
7+
- ./data:/app/data
8+
- ./session:/root/.find-my-timeline
9+
env_file:
10+
- .env
11+
environment:
12+
- WEB_HOST=0.0.0.0
13+
restart: unless-stopped

0 commit comments

Comments
 (0)