-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
59 lines (55 loc) · 1.43 KB
/
Copy pathdocker-compose.yml
File metadata and controls
59 lines (55 loc) · 1.43 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
49
50
51
52
53
54
55
56
57
58
59
# Containerized stack: PostgreSQL + the scraping app.
#
# docker compose build
# docker compose run --rm app # runs the E1–E5 demo (default CMD)
# docker compose run --rm app python main.py # full pipeline
# docker compose up scheduler # hourly automation
#
# Postgres is exposed on host port 5544 so it never collides with a local
# PostgreSQL on 5432/5433.
services:
db:
image: postgres:16
environment:
POSTGRES_DB: tienda
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5544:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d tienda"]
interval: 3s
timeout: 3s
retries: 15
volumes:
- pgdata:/var/lib/postgresql/data
app:
build: .
depends_on:
db:
condition: service_healthy
environment:
PGHOST: db
PGPORT: "5432"
PGDATABASE: tienda
PGUSER: postgres
PGPASSWORD: postgres
STATIC_BASE_URL: http://localhost:8000/
# CMD from the Dockerfile (the demo) runs by default.
# Optional: hourly automation as a long-running service.
scheduler:
build: .
depends_on:
db:
condition: service_healthy
environment:
PGHOST: db
PGPORT: "5432"
PGDATABASE: tienda
PGUSER: postgres
PGPASSWORD: postgres
command: ["python", "scheduler.py"]
restart: unless-stopped
profiles: ["automation"]
volumes:
pgdata: