通过docker-compose构建redmine项目管理系统

redmine配置文件如下,执行docker-compose -f redmine.yml up -d 已经构建成功,但是打不开redmine网页。

version: ‘2’
services:
postgresql:
image: sameersbn/postgresql:9.6-4
container_name: ‘redmine-sql-th’
environment:
- DB_USER=redmine
- DB_PASS=password
- DB_NAME=redmine_production
volumes:
- /home/shuch/redmine/postgresql:/var/lib/postgresql

redmine:
image: sameersbn/redmine:4.1.1-6
container_name: ‘redmine-th’
depends_on:
- postgresql
environment:
- TZ=Asia/Kolkata

- DB_ADAPTER=postgresql
- DB_HOST=postgresql
- DB_PORT=5432
- DB_USER=redmine
- DB_PASS=password
- DB_NAME=redmine_production

- REDMINE_PORT=8083
- REDMINE_HTTPS=false
- REDMINE_RELATIVE_URL_ROOT=
- REDMINE_SECRET_TOKEN=

- REDMINE_SUDO_MODE_ENABLED=false
- REDMINE_SUDO_MODE_TIMEOUT=15

- REDMINE_CONCURRENT_UPLOADS=2

- REDMINE_BACKUP_SCHEDULE=
- REDMINE_BACKUP_EXPIRY=
- REDMINE_BACKUP_TIME=

- SMTP_ENABLED=false
- SMTP_METHOD=smtp
- SMTP_DOMAIN=www.example.com
- SMTP_HOST=smtp.gmail.com
- SMTP_PORT=587
- SMTP_USER=mailer@example.com
- SMTP_PASS=password
- SMTP_STARTTLS=true
- SMTP_AUTHENTICATION=:login

- IMAP_ENABLED=false
- IMAP_HOST=imap.gmail.com
- IMAP_PORT=993
- IMAP_USER=mailer@example.com
- IMAP_PASS=password
- IMAP_SSL=true
- IMAP_INTERVAL=30

ports:
- "8083:8080"
volumes:
- /home/shuch/redmine/redmine:/home/redmine/data

执行后报错日志(加粗)如下:*

[root@192 redmine]# docker-compose -f redmine.yml up -d
Creating network “redmine_default” with the default driver
Pulling postgresql (sameersbn/postgresql:9.6-4)…
9.6-4: Pulling from sameersbn/postgresql
6b98dfc16071: Pull complete
4001a1209541: Pull complete
6319fc68c576: Pull complete
b24603670dc3: Pull complete
97f170c87c6f: Pull complete
02befcbfa4bc: Pull complete
703f657e352c: Pull complete
d5bfe11f5126: Pull complete
cfbe776bd60f: Pull complete
cc092b9fffcf: Pull complete
f5d746359f3e: Pull complete
Digest: sha256:518664a770e57fb023fb5cc5c3b3e492802f898d32f226481a1bf2c3d6ad4a20
Status: Downloaded newer image for sameersbn/postgresql:9.6-4
Pulling redmine (sameersbn/redmine:4.1.1-6)…
4.1.1-6: Pulling from sameersbn/redmine
34667c7e4631: Pull complete
d18d76a881a4: Pull complete
119c7358fbfc: Pull complete
2aaf13f3eff0: Pull complete
44198ff24d9e: Pull complete
9e46cd3a43de: Pull complete
98a6019ef8b1: Pull complete
ae50f8d36e0c: Pull complete
e0e65efffaa8: Pull complete
dee68640dcf0: Pull complete
9500fde01ba7: Pull complete
60dce4b927fa: Pull complete
71c64fa858fc: Pull complete
eaf28e2ea4f7: Pull complete
221c4a46c066: Pull complete
Digest: sha256:c77c5c6d79dc1e615a36ea3c3d492d181d7f6ee2e359118255bb49dea16cdc6b
Status: Downloaded newer image for sameersbn/redmine:4.1.1-6
Creating redmine-sql-th … done
Creating redmine-th … done
[root@192 redmine]# docker logs redmine-th
Initializing logdir…
Initializing datadir…
Symlinking dotfiles…
Installing configuration templates…
Configuring redmine…
Configuring redmine::database…
Configuring redmine::unicorn…
Configuring redmine::secret_token…
Generating a session token…
Note:
All old sessions will become invalid.
Please specify the REDMINE_SECRET_TOKEN parameter for persistence.
SHOULD be defined if you have a load-balancing Redmine cluster.
Configuring redmine::max_concurrent_ajax_uploads…
Configuring redmine::sudo_mode…
Configuring redmine::autologin_cookie…
Configuring redmine::backups…
Configuring nginx…
Configuring nginx::redmine…
Installing plugins…
Installing themes…
2021-05-29 17:31:55,514 CRIT Supervisor running as root (no user in config file)
2021-05-29 17:31:55,517 WARN Included extra file “/etc/supervisor/conf.d/cron.conf” during parsing
2021-05-29 17:31:55,517 WARN Included extra file “/etc/supervisor/conf.d/nginx.conf” during parsing
2021-05-29 17:31:55,517 WARN Included extra file “/etc/supervisor/conf.d/unicorn.conf” during parsing
2021-05-29 17:31:55,526 INFO RPC interface ‘supervisor’ initialized
2021-05-29 17:31:55,526 INFO supervisord started with pid 1
2021-05-29 17:31:56,528 INFO spawned: ‘unicorn’ with pid 247
2021-05-29 17:31:56,530 INFO spawned: ‘cron’ with pid 248
2021-05-29 17:31:56,531 INFO spawned: ‘nginx’ with pid 249
2021-05-29 17:31:58,038 INFO success: unicorn entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-05-29 17:31:58,038 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-05-29 17:31:58,038 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
[root@192 redmine]# docker logs redmine-sql-th
Initializing datadir…
Initializing certdir…
Initializing logdir…
Initializing rundir…
Setting resolv.conf ACLs…
Creating database user: redmine
Creating database: redmine_production…
‣ Granting access to redmine user…
Starting PostgreSQL 9.6…
LOG: database system was shut down at 2021-05-29 12:01:53 UTC
LOG: MultiXact member wraparound protections are now enabled
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
[root@192 redmine]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d5209702ff85 sameersbn/redmine:4.1.1-6 “/sbin/entrypoint.sh…” 6 minutes ago Up 6 minutes 80/tcp, 443/tcp, 0.0.0.0:8083->8080/tcp redmine-th
fc2c0a8f55e8 sameersbn/postgresql:9.6-4 “/sbin/entrypoint.sh” 6 minutes ago Up 6 minutes 5432/tcp redmine-sql-th

用netstat和docker ps去看下容器的开放端口,以及你本地的影射端口。然后再打开对应的端口,不要访问错地址