-
Notifications
You must be signed in to change notification settings - Fork 96
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
104 lines (104 loc) · 2.78 KB
/
docker-compose.yaml
File metadata and controls
104 lines (104 loc) · 2.78 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Development environment with MySQL and MinIO services
#
# NOTE: docker-compose is OPTIONAL for running tests.
# Tests use testcontainers to automatically manage containers.
# Just run: pytest tests/
#
# Use docker-compose for development/debugging when you want
# persistent containers that survive test runs:
# docker compose up -d db minio # Start services manually
# pytest tests/ # Tests will use these containers
#
# Full Docker testing (CI):
# docker compose --profile test up djtest --build
services:
db:
image: datajoint/mysql:${MYSQL_VER:-8.0}
environment:
- MYSQL_ROOT_PASSWORD=${DJ_PASS:-password}
command: mysqld --default-authentication-plugin=mysql_native_password
ports:
- "3306:3306"
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
timeout: 30s
retries: 5
interval: 15s
postgres:
image: postgres:${POSTGRES_VER:-15}
environment:
- POSTGRES_PASSWORD=${PG_PASS:-password}
- POSTGRES_USER=${PG_USER:-postgres}
- POSTGRES_DB=${PG_DB:-test}
ports:
- "5432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
timeout: 30s
retries: 5
interval: 15s
minio:
image: minio/minio:${MINIO_VER:-RELEASE.2025-02-28T09-55-16Z}
environment:
- MINIO_ACCESS_KEY=datajoint
- MINIO_SECRET_KEY=datajoint
ports:
- "9000:9000"
command: server --address ":9000" /data
healthcheck:
test:
- "CMD"
- "curl"
- "--fail"
- "http://localhost:9000/minio/health/live"
timeout: 30s
retries: 5
interval: 15s
app:
image: datajoint/datajoint:${DJ_VERSION:-latest}
build:
context: .
dockerfile: Dockerfile
args:
PY_VER: ${PY_VER:-3.10}
HOST_UID: ${HOST_UID:-1000}
depends_on:
db:
condition: service_healthy
postgres:
condition: service_healthy
minio:
condition: service_healthy
environment:
- DJ_HOST=db
- DJ_USER=root
- DJ_PASS=password
- DJ_TEST_HOST=db
- DJ_TEST_USER=datajoint
- DJ_TEST_PASSWORD=datajoint
- DJ_PG_HOST=postgres
- DJ_PG_USER=postgres
- DJ_PG_PASS=password
- DJ_PG_PORT=5432
- S3_ENDPOINT=minio:9000
- S3_ACCESS_KEY=datajoint
- S3_SECRET_KEY=datajoint
- S3_BUCKET=datajoint.test
- PYTHON_USER=dja
- JUPYTER_PASSWORD=datajoint
working_dir: /src
user: ${HOST_UID:-1000}:mambauser
volumes:
- .:/src
djtest:
extends:
service: app
profiles: ["test"]
command:
- sh
- -c
- |
set -e
pip install -q -e ".[test]"
pip freeze | grep datajoint
pytest --cov-report term-missing --cov=datajoint tests