I am using Redmine in a docker container with a SQL Server database. Often times when doing a search we see an error page. Before the Docker days, my fix was to add a timeout in the database.yml file:
production:
adapter: "sqlserver"
host: "MYDBHOST"
port: "1433"
username: "MYDBUSER"
password: "MYDBUSERPASSWORD"
database: "Redmine"
encoding: "utf8"
timeout: 30000
But in the compose.yml, there seems to be no environment variable to define the database timeout.
I had to remove the environment section and map the database.yml file (with the timeout defined) from the host's folder to the docker container to solve the search error problem.
It would be nice to define the database timeout in the environment section though. Is that possible?
And it would also be nice to define the mail server settings in the environment section, instead of mapping the configuration.yml file from the host to do so. Am I missing something?
Fixed with the workaround to use config files from the host instead of using environment variables:
version: '3.1'
# Build and run redmine docker image
#
# To run the image: sudo docker compose up
# Append -d to run detached (in the background)
# to run with upgrading of plugins, add -e REDMINE_PLUGINS_MIGRATE=1:
#
# $ sudo docker compose run -e REDMINE_PLUGINS_MIGRATE=1
services:
redmine:
image: redmine:5.0.5
container_name: redmine
restart: always
ports:
- 80:3000
#environment:
# these have been moved to assets/config/database.yml so we can specify the timeout
volumes:
- /home/myuser/redmine-docker/assets/plugins:/usr/src/redmine/plugins
- /home/myuser/redmine-docker/assets/themes:/usr/src/redmine/public/themes
- /home/myuser/redmine-docker/assets/files:/usr/src/redmine/files
- /home/myuser/redmine-docker/assets/config/configuration.yml:/usr/src/redmine/config/configuration.yml
- /home/myuser/redmine-docker/assets/config/database.yml:/usr/src/redmine/config/database.yml