Hi,
I’m trying to run the Dockerized Specify all-in-one installation on our office Red Hat Enterprise Linux dev/internal server.
I have replaced host.docker.internal by 172.17.0.1 in my custom docker-compose file as explained here on the Specify post: Install Specify 7 with Docker (macOS & Ubuntu) - Documentation / Configuration & Installation - Specify Community Forum (specifysoftware.org)
I was successful in connecting to the DB with DBeaver (port 3306) however the web portal gives me a NGINX error message (502 Bad Gateway).
Here are the Specify7 Docker logs:
File "/opt/specify7/ve/lib/python3.8/site-packages/MySQLdb/__init__.py", line 85, in Connect
return Connection(*args, **kwargs)
File "/opt/specify7/ve/lib/python3.8/site-packages/MySQLdb/connections.py", line 204, in __init__
super(Connection, self).__init__(*args, **kwargs2)
django.db.utils.OperationalError: (2005, "Unknown MySQL server host 'mariadb' (-2)")
There seems to be an issue with Specify-7 trying to fin the DB.
My docker-compose.yml file:
version: '3.7'
services:
mariadb:
restart: unless-stopped
image: mariadb
command: --max_allowed_packet=1073741824
ports:
- "${MYSQL_EXTERNAL_PORT}:3306"
volumes:
- "database:/var/lib/mysql"
- "./seed-database:/docker-entrypoint-initdb.d"
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
specify7:
restart: unless-stopped
image: specifyconsortium/specify7-service:v7.7
init: true
volumes:
- "specify6:/opt/Specify:ro"
- "static-files:/volumes/static-files"
environment:
- DATABASE_HOST=mariadb
- DATABASE_PORT=3306
- DATABASE_NAME=${MYSQL_DATABASE}
- MASTER_NAME=${MYSQL_USER}
- MASTER_PASSWORD=${MYSQL_PASSWORD}
- SECRET_KEY=${SPECIFY_SECRET_KEY}
- ASSET_SERVER_URL=http://172.17.0.1/web_asset_store.xml
- ASSET_SERVER_KEY=${ASSET_SERVER_KEY}
- REPORT_RUNNER_HOST=report-runner
- REPORT_RUNNER_PORT=8080
- CELERY_BROKER_URL=redis://redis/0
- CELERY_RESULT_BACKEND=redis://redis/1
- LOG_LEVEL=WARNING
- SP7_DEBUG=false
specify7-worker:
restart: unless-stopped
image: specifyconsortium/specify7-service:v7.7
command: ve/bin/celery -A specifyweb worker -l INFO --concurrency=1
init: true
volumes:
- "specify6:/opt/Specify:ro"
- "static-files:/volumes/static-files"
environment:
- DATABASE_HOST=mariadb
- DATABASE_PORT=3306
- DATABASE_NAME=${MYSQL_DATABASE}
- MASTER_NAME=${MYSQL_USER}
- MASTER_PASSWORD=${MYSQL_PASSWORD}
- SECRET_KEY=${SPECIFY_SECRET_KEY}
- ASSET_SERVER_URL=http://172.17.0.1/web_asset_store.xml
- ASSET_SERVER_KEY=${ASSET_SERVER_KEY}
- REPORT_RUNNER_HOST=report-runner
- REPORT_RUNNER_PORT=8080
- CELERY_BROKER_URL=redis://redis/0
- CELERY_RESULT_BACKEND=redis://redis/1
- LOG_LEVEL=WARNING
- SP7_DEBUG=false
asset-server:
restart: unless-stopped
image: specifyconsortium/specify-asset-service
init: true
volumes:
- "attachments:/home/specify/attachments"
environment:
- SERVER_NAME=172.17.0.1
- SERVER_PORT=80
- ATTACHMENT_KEY=${ASSET_SERVER_KEY}
- DEBUG_MODE=false
specify6:
image: specifyconsortium/specify6-service:6.8.02
volumes:
- "specify6:/volumes/Specify"
nginx:
restart: unless-stopped
image: nginx
ports:
- "${SPECIFY_EXTERNAL_PORTAL_PORT}:80"
volumes:
- "static-files:/volumes/static-files:ro"
- "specify6:/volumes/specify6:ro"
- "./nginx/specify.conf:/etc/nginx/conf.d/default.conf:ro"
report-runner:
restart: unless-stopped
image: specifyconsortium/report-runner
redis:
restart: unless-stopped
image: redis:6.0
volumes:
attachments: # the asset-servers attachment files
database: # the data directory for mariadb
specify6: # provides Specify 6 files to Specify 7 and the web server
static-files: # provides Specify 7 static files to the web server
My .env file with the variables for the compose file:
YOUR_IP_HERE=s0-bsc-alfcwdev
SPECIFY_EXTERNAL_PORTAL_PORT=8090
MYSQL_EXTERNAL_PORT=3307
MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=specify
MYSQL_USER=master
MYSQL_PASSWORD=master
SPECIFY_SECRET_KEY=ifindyourlackoffaithdisturbing
ASSET_SERVER_KEY=thiswillbeadaylongremembered