Repository navigation
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
101 lines (101 loc) · 2.78 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
101 lines (101 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
# Development environment with MySQL, PostgreSQL, and S3 (SeaweedFS) 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 s3 # 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
s3:
# Same image as the test fixture in tests/conftest.py
image: chrislusf/seaweedfs:${SEAWEEDFS_VER:-4.48}
environment:
- AWS_ACCESS_KEY_ID=datajoint
- AWS_SECRET_ACCESS_KEY=datajoint
ports:
- "8333:8333"
command: server -s3 -ip.bind=0.0.0.0
healthcheck:
test: [ "CMD", "nc", "-z", "localhost", "8333" ]
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
s3:
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=s3:8333
- 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