1
+ version : ' 2.2'
2
+ x-net : &net
3
+ networks :
4
+ - main
5
+ services :
6
+ app :
7
+ << : *net
8
+ image : datajoint/pydev:${PY_VER}-alpine${ALPINE_VER}
9
+ depends_on :
10
+ db :
11
+ condition : service_healthy
12
+ minio :
13
+ condition : service_healthy
14
+ environment :
15
+ - DJ_HOST=db
16
+ - DJ_USER=root
17
+ - DJ_PASS=simple
18
+ - DJ_TEST_HOST=db
19
+ - DJ_TEST_USER=datajoint
20
+ - DJ_TEST_PASSWORD=datajoint
21
+ # If running tests locally, make sure to add entry in /etc/hosts for 127.0.0.1 fakeminio.datajoint.io
22
+ - S3_ENDPOINT=fakeminio.datajoint.io:9000
23
+ - S3_ACCESS_KEY=datajoint
24
+ - S3_SECRET_KEY=datajoint
25
+ - S3_BUCKET=datajoint-test
26
+ - PYTHON_USER=dja
27
+ - JUPYTER_PASSWORD=datajoint
28
+ - DISPLAY
29
+ working_dir : /src
30
+ command : >
31
+ /bin/sh -c
32
+ "
33
+ pip install --user nose nose-cov coveralls ptvsd .;
34
+ pip freeze | grep datajoint;
35
+ ## You may run the below tests once sh'ed into container i.e. docker exec -it datajoint-python_app_1 sh
36
+ # nosetests -vsw tests --with-coverage --cover-package=datajoint; #run all tests
37
+ # nosetests -vs --tests=tests.test_external_class:test_insert_and_fetch; #run specific basic test
38
+ # nosetests -vs --tests=tests.test_fetch:TestFetch.test_getattribute_for_fetch1; #run specific Class test
39
+ ## Interactive Jupyter Notebook environment
40
+ jupyter notebook &
41
+ ## Remote debugger
42
+ while true;
43
+ do python -m ptvsd --host 0.0.0.0 --port 5678 --wait .;
44
+ sleep 2;
45
+ done;
46
+ "
47
+ ports :
48
+ - " 8888:8888"
49
+ - " 5678:5678"
50
+ user : ${UID}:${GID}
51
+ volumes :
52
+ - .:/src
53
+ - /tmp/.X11-unix:/tmp/.X11-unix:rw
54
+ # Additional mounted notebooks may go here
55
+ # - ./notebook:/home/dja/notebooks
56
+ # - ../dj-python-101/ch1:/home/dja/tutorials
57
+ db :
58
+ << : *net
59
+ image : datajoint/mysql:$MYSQL_VER
60
+ environment :
61
+ - MYSQL_ROOT_PASSWORD=simple
62
+ ports :
63
+ - " 3306:3306"
64
+ # To persist MySQL data
65
+ # volumes:
66
+ # - ./mysql/data:/var/lib/mysql
67
+ minio :
68
+ << : *net
69
+ environment :
70
+ - MINIO_ACCESS_KEY=datajoint
71
+ - MINIO_SECRET_KEY=datajoint
72
+ image : minio/minio:$MINIO_VER
73
+ # To persist MinIO data and config
74
+ # volumes:
75
+ # - ./minio/data:/data
76
+ # - ./minio/config:/root/.minio
77
+ command : server /data
78
+ healthcheck :
79
+ test : ["CMD", "curl", "--fail", "http://minio:9000/minio/health/live"]
80
+ timeout : 5s
81
+ retries : 60
82
+ interval : 1s
83
+ fakeminio.datajoint.io :
84
+ << : *net
85
+ image : nginx:alpine
86
+ environment :
87
+ - URL=datajoint.io
88
+ - SUBDOMAINS=fakeminio
89
+ - MINIO_SERVER=http://minio:9000
90
+ entrypoint : /entrypoint.sh
91
+ healthcheck :
92
+ test : wget --quiet --tries=1 --spider https://fakeminio.datajoint.io:443/minio/health/live || exit 1
93
+ timeout : 5s
94
+ retries : 300
95
+ interval : 1s
96
+ ports :
97
+ - " 9000:9000"
98
+ - " 443:443"
99
+ volumes :
100
+ - ./tests/nginx/base.conf:/base.conf
101
+ - ./tests/nginx/entrypoint.sh:/entrypoint.sh
102
+ - ./tests/nginx/fullchain.pem:/certs/fullchain.pem
103
+ - ./tests/nginx/privkey.pem:/certs/privkey.pem
104
+ networks :
105
+ main:
0 commit comments