Install redmine plug-in using docker container
No need to explain what was said at the docker-composer level
version: '3'
services:
redmine:
image: redmine
restart: always
ports:
- 3000:3000
environment:
- REDMINE_DB_MYSQL=mysql_redmine
- REDMINE_DB_USERNAME=root
- REDMINE_DB_PASSWORD=pass
- REDMINE_PLUGINS_MIGRATE=true
volumes:
- ./redmine_data:/usr/src/redmine/files
- ./redmine-plugins:/usr/src/redmine/plugins
mysql_redmine:
image: mysql:5.7
restart: always
environment:
- MYSQL_ROOT_PASSWORD=pass
- MYSQL_DATABASE=redmine
volumes:
- ./mysql-data_red:/var/lib/mysql
The environment variable REDMINE_PLUGINS_MIGRATE
gives the possibility to migrate directly your plugins !
also there is no need to enter in the container
Now you just need to use git submodule add
with your plugin git repository in ./redmine-plugins
You can preserve plugins between container recreations by adding additional data volumes to keep them. Since spawning docker containers without docker-compose
is a pain, let me use it for further explanation.
1. Create docker-compose.yml
describing your setup
It should create two services (one for each of MySQL and Redmine) in a separate bridged network:
version: '2'
networks:
redmine-network:
volumes:
redmine-plugins:
redmine-themes:
redmine-data:
services:
mysql-for-redmine:
image: mysql:5.6
networks:
- redmine-network
volumes:
# Consider using separate volume containers
# instead of host directory mounts.
- /my/custom:/etc/mysql/conf.d
- /storage/mysql/datadir:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: "<india>"
MYSQL_DATABASE: "redmine"
redmine:
image: redmine:3.3-passenger
ports:
- 3000:3000
networks:
- redmine-network
volumes:
- redmine-plugins:/usr/src/redmine/plugins
- redmine-themes:/usr/src/redmine/public/themes
- redmine-data:/usr/src/redmine/files
environment:
# Host name matches the MySQL container name.
REDMINE_DB_MYSQL: "mysql-for-redmine"
REDMINE_DB_USERNAME: "root"
REDMINE_DB_PASSWORD: "<india>"
REDMINE_SECRET_KEY_BASE: "..."
restart: always
2. Deploy your config
Simply run docker-compose up -d
from the directory where you put your configuration file.
3. Install your plugins (and themes) manually
Find the name of the container running Redmine with docker ps
; on my system it's root_redmine_1
. Run the following to attach into it:
# docker exec -ti root_redmine_1 gosu redmine bash
It will open a shell for "redmine" user inside the container. Use wget
and tar xjf
to download and extract plugins you need. Exit the shell when it's done.
4. Restart your instance to check if plugins work
Cast docker restart root_redmine_1
command and see if it's working as supposed. Since the plugins are put on a separate data volume, they should survive container recreation as well.