-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.ci.yml
More file actions
68 lines (65 loc) · 2.42 KB
/
Copy pathdocker-compose.ci.yml
File metadata and controls
68 lines (65 loc) · 2.42 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
60
61
62
63
64
65
66
67
68
# CI-friendly docker-compose for E2E tests.
# Bind-mounts live source over the built image so edits are picked up on
# container restart without a rebuild.
#
# Usage:
# SCENARIO=ci-normal-day docker compose -f docker-compose.ci.yml up -d
# # Wait for http://localhost:8080/api/system-health to respond
# # Run Playwright tests
# docker compose -f docker-compose.ci.yml down
services:
bess:
build:
context: .
dockerfile: backend/Dockerfile.dev
environment:
- HA_URL=http://mock-ha:8123
- HA_TOKEN=mock_token
- HA_TEST_MODE=false
- TZ=Europe/Stockholm
- PYTHONPATH=/app/backend:/app
# Empty by default (no-op). Set both to pin the container's wall clock
# to a scenario's mock_time, e.g. for a scenario that pins mock_time to
# a fixed past date and needs date-anchored price lookups to match.
# See backend/Dockerfile.dev for the fixed libfaketime.so.1 symlink path.
- LD_PRELOAD=${BESS_FAKETIME_PRELOAD:-}
- FAKETIME=${BESS_FAKETIME:-}
ports:
- "${BESS_PORT:-8080}:8080"
volumes:
- ./backend:/app/backend:ro
- ./core:/app/core:ro
- ./frontend/dist:/app/frontend:ro
- ${BESS_OPTIONS:-./e2e/ci-options.json}:/data/options.json:ro
- ${BESS_SETTINGS:-./e2e/ci-bess-settings.json}:/data/bess_settings.json
# Dockerfile.dev's WORKDIR is /app, which the image also uses as the
# build-time COPY destination for backend/*.py — without this override,
# sys.path[0] resolves to that stale baked copy instead of the live
# bind-mounted /app/backend, so backend-root edits (app.py, api.py, ...)
# would silently not take effect on restart. Matches docker-compose.yml's
# dev setup, which cds into /app/backend before invoking uvicorn.
working_dir: /app/backend
command: ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080"]
depends_on:
mock-ha:
condition: service_healthy
networks:
- ci-network
mock-ha:
build: ./scripts/mock_ha
environment:
- SCENARIO=${SCENARIO:-ci-normal-day}
ports:
- "${MOCK_HA_PORT:-8123}:8123"
volumes:
- ./scripts/mock_ha/scenarios:/scenarios:ro
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8123/mock/sensors')"]
interval: 3s
timeout: 3s
retries: 10
networks:
- ci-network
networks:
ci-network:
driver: bridge