-
-
Notifications
You must be signed in to change notification settings - Fork 707
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
63 lines (59 loc) · 2.2 KB
/
docker-compose.test.yml
File metadata and controls
63 lines (59 loc) · 2.2 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
# vim: ft=yaml.docker-compose
services:
anthias-test:
# Both anthias-test and anthias-celery declare the same image tag
# AND the same build block. Compose deduplicates the build by
# image tag, so the image is produced once; ghcr layer cache
# (configured by ``tools.image_builder`` via the Dockerfile's
# ``# syntax`` line + ``--mount=type=cache`` and the buildx
# invocation in ci) is hit by both service builds. Sharing the
# ``build:`` block also keeps either service from triggering a
# registry pull for the local-only ``anthias-test:dev`` tag.
image: anthias-test:dev
build: &test_build
context: .
dockerfile: docker/Dockerfile.test
environment:
- HOME=/data
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- ENVIRONMENT=test
# Pin the test DB to the writable volume mount on /data so CI
# keeps its historic location. Local runs (no override) fall back
# to a repo-local path inside BASE_DIR — see
# src/anthias_server/django_project/settings.py.
- ANTHIAS_TEST_DB_PATH=/data/.anthias/test.db
stdin_open: true
tty: true
volumes:
- .:/usr/src/app
- anthias-data:/data
anthias-celery:
# Same image as anthias-test (test image is a superset of server:
# same base apt + venv + bun + chrome for selenium); only the CMD
# differs. Sharing the ``build:`` anchor lets compose route this
# service through the ghcr layer cache too instead of attempting
# a Docker Hub pull on the local-only ``anthias-test:dev`` tag.
image: anthias-test:dev
build: *test_build
command: >
celery -A anthias_server.celery_tasks.celery worker -B -n worker@anthias
--loglevel=info --schedule /tmp/celerybeat-schedule
depends_on:
anthias-test:
condition: service_started
redis:
condition: service_started
environment:
- HOME=/data
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
restart: always
volumes:
- .:/usr/src/app
- anthias-data:/data
redis:
image: mirror.gcr.io/library/redis:alpine
volumes:
anthias-data:
redis-data: