-
Notifications
You must be signed in to change notification settings - Fork 36
/
docker-compose.yml
111 lines (102 loc) · 3.59 KB
/
docker-compose.yml
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
105
106
107
108
109
110
111
# This is a Development Docker Composition of Specify 7
# It has nice features like hot reloading and debugging support
# However, it is not suited for production use due to memory leaks and security
# issues
# Though, you can use it for evaluation of Specify 7
#
# Full Documentation for the Development Docker Composition:
# https://github.com/specify/specify7/wiki/Docker-Workflow-for-Development
#
# Members of Specify Collections Consortium get access to production-ready
# Docker compositions. Please contact us at [email protected]
# if you would like to get access
#
version: "3.7"
services:
mariadb:
image: mariadb:10.11
volumes:
- "database:/var/lib/mysql" # the data directory for mariadb
- "./seed-database:/docker-entrypoint-initdb.d"
ports:
- "127.0.0.1:3306:3306" # map host port 3306 to container port 3306
command: --max_allowed_packet=1073741824
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE=${DATABASE_NAME}
- MYSQL_USER=${MASTER_NAME}
- MYSQL_PASSWORD=${MASTER_PASSWORD}
specify7:
build:
context: ./.
target: run-development
command: ve/bin/python manage.py runserver 0.0.0.0:8000
init: true
restart: unless-stopped
depends_on:
# It seems like there was a race condition on the the
# webpack-output volume. I suspect if this container mounts it
# first, the mount point ends up owned by root instead of the
# node user in the webpack container. Adding webpack to the
# depends_on will hopefully stop that.
- webpack
- mariadb
volumes:
- "./config:/opt/Specify/config:ro" # provides Specify 6 files to Specify 7 and the web server
- "static-files:/volumes/static-files" # provides Specify 7 static files to the web server
- "./specifyweb:/opt/specify7/specifyweb"
- "webpack-output:/opt/specify7/specifyweb/frontend/static/js:ro" # mount webpack output as read-only
extra_hosts:
- "host.docker.internal:host-gateway"
env_file: .env
webpack:
build:
context: ./.
target: build-frontend
command: npx webpack -w --mode development --color
restart: unless-stopped
volumes:
- "webpack-output:/home/node/dist"
- "./specifyweb/frontend/js_src/lib:/home/node/lib:ro"
- "./specifyweb/frontend/js_src/css:/home/node/css:ro"
specify7-worker:
build:
context: ./.
target: run-development
command: bash -c "ve/bin/celery -A specifyweb worker -l INFO --concurrency=1 -Q $DATABASE_NAME"
init: true
volumes:
- "./config:/opt/Specify/config:ro"
- "static-files:/volumes/static-files"
- "./specifyweb:/opt/specify7/specifyweb"
extra_hosts:
- "host.docker.internal:host-gateway"
env_file: .env
redis:
image: redis
asset-server:
image: specifyconsortium/specify-asset-service
init: true
volumes:
- "attachments:/home/specify/attachments"
environment:
- SERVER_NAME=host.docker.internal
- SERVER_PORT=80
- ATTACHMENT_KEY=${ASSET_SERVER_KEY}
- DEBUG_MODE=false
nginx:
image: nginx:alpine
ports:
- "80:80"
volumes:
- "static-files:/volumes/static-files:ro"
- "./config:/volumes/specify-config:ro"
- "webpack-output:/volumes/webpack-output:ro"
- "./nginx.conf:/etc/nginx/conf.d/default.conf:ro"
report-runner:
image: specifyconsortium/report-runner
volumes:
attachments: # the asset-servers attachment files
database: # the data directory for mariadb
static-files: # provides Specify 7 static files to the web server
webpack-output: