Sekarang kita akan melakukan install Redmine dan MariaDB di atas docker compose. Silakan untuk dipastikan sudah terinstall docker dengan mode docker swarm
1. Membuat file docker-compose.yml
version: '3.7' configs: redmine_config.yml: external: true ## Membuat volume untuk container volumes: redmine: {} redmine-plugins: {} redmine-themes: {} redmine-configs: {} mariadb: {} ## Membuat network internal antar services networks: net: driver: overlay attachable: true ## Mendeskripsikan service yang akan digunakan services: redmine: image: redmine:4.0 ports: - target: 3000 published: 3000 protocol: tcp mode: host environment: - REDMINE_DB_DATABASE=dbredmine - REDMINE_DB_USERNAME=redmine - REDMINE_DB_PASSWORD=redmine123 - REDMINE_DB_MYSQL=mariadb - REDMINE_PLUGINS_MIGRATE=true //Untuk mengaktifkan plugin redmine volumes: - redmine:/usr/src/redmine/files - redmine-plugins:/usr/src/redmine/plugins - redmine-themes:/usr/src/redmine/public/themes - redmine-configs:/usr/src/redmine/config networks: - net deploy: mode: replicated replicas: 1 placement: constraints: - node.role == master resources: limits: memory: 256M reservations: memory: 128M mariadb: image: mariadb:10.2.30-bionic environment: - MYSQL_ROOT_PASSWORD=inipassword - MYSQL_DATABASE=dbredmine - MYSQL_USER=redmine - MYSQL_PASSWORD=redmine123 volumes: - mariadb:/var/lib/mysql networks: - net deploy: mode: replicated replicas: 1 placement: constraints: - node.role == master resources: limits: memory: 256M reservations: memory: 128M
2. Dengan cara deploy pada stack docker swarm dengan perintah
docker stack deploy -c docker-compose.yml redmine
Link Referensi :
https://hub.docker.com/_/redmine