首页 » docker » docker中启动redmine的问题

docker中启动redmine的问题

 

在docker中启动redmine,redmine用官方的镜像,最新的版本是3.3.0stable,可以使用它自己的SQLite,也可以用外围的mysql,postgresql,下面是用外置的mysql来配置,

1、可以用外置的数据库和docker启的数据库,都要创建redmine用的数据库,如下:

CREATE DATABASE redmine CHARACTER SET utf8;
grant all on redmine.* to redmine@'%' identified by 'secret';

2、配置数据库配置文件,然后挂载到redmine对应的配置文件,

[chenlc@gitlab redmine]$ cat database.yml 
# Default setup is given for MySQL with ruby1.9.
# Examples for PostgreSQL, SQLite3 and SQL Server can be found at the end.
# Line indentation must be 2 spaces (no tabs).

production:
 adapter: mysql2
 database: redmine
 host: db
 port: 3306
 username: redmine
 password: "123456"
 encoding: utf8

3、启动redmine,前提是数据库已经启动了。

以下对一些有用的文件放在宿主上,防止容器坏了,数据丢了。

docker run -d --name redmine -p 3000:3000 -v /home/chenlc/docker/redmine/files:/usr/src/redmine/files -v /home/chenlc/docker/redmine/log:/usr/src/redmine/log  -v /home/chenlc/docker/redmine/sqlite:/usr/src/redmine/sqlite  -v /home/chenlc/docker/redmine/database.yml:/usr/src/redmine/config/database.yml --link db:db_redmine  -v /etc/localtime:/etc/localtime redmine

4、然后就可以在网页中访问:ip:3000,默认的用户名和密码都是:admin,

5、但发现一个问题,没有新建问题的按键

解决方法:

https://github.com/sameersbn/docker-redmine/issues/92

在上面找到了,先用管理员进去,找到左上角的配置选项,点进去会弹出是否加载默认配置,点是加载一下默认配置就可以create issue。

 

@woshihaoren @DanielBadura I think i know why this could be happening. I used the following docker-compose.yml file to start redmine

mysql:
  image: sameersbn/mysql:latest
  environment:
    - DB_USER=redmine
    - DB_PASS=password
    - DB_NAME=redmine_production
redmine:
  image: sameersbn/redmine:3.0.2
  links:
    - mysql:mysql
  ports:
    - "18080:80"
docker-compose up

This starts redmine with mysql and redmine in containers and the application is accessible at http://localhost:18080

Once I login as root, If I create a project. There is no “New Issue” tab. This is because, the default configuration was not loaded from the administration page. I have to first visit the “Administration” page and see the below message.

8207491

Here I need to select the “Load Default Configuration”.

Now when I create a new project, I can see the “New Issue” button

 

 

原文链接:docker中启动redmine的问题,转载请注明来源!

0