0

I'm trying to get redmine running in docker. I'm new to both.

I'm using the "default" redmine image (version 3.3, because version 4.X is not yet supported by redmine mobile apps).

I have the issue that the redmine container starts before the db is ready, and fails. So I just want to try and build a "sleep" in the container using "command", but I need to work out how to start redmine using "command". From what I found, I need to call "/docker-entrypoint.sh", but this doesn't work:

command: >
/docker-entrypoint.sh

I think this is the actual start script (from the current version:) docker-entrypoint.sh

Sebastien Diot
  • 7,183
  • 6
  • 43
  • 85
  • you can use `entrypoint` keyword in docker-compose.yml but i think you don't need to call the entrypoint itself. you might need to try this in case of mysql with port 3306 or postgres with port 5432 `command: ["./wait-for-it.sh", "db:3306", "--", "rails", "server", "-b", "0.0.0.0"]` assuming that you have added wait-for-it script to redmine image https://github.com/vishnubob/wait-for-it – Mostafa Hussein Mar 09 '19 at 15:05
  • You can find a full details about the database issue in my answer in here: https://stackoverflow.com/a/55033751/2336650 – Mostafa Hussein Mar 09 '19 at 15:09
  • @MostafaHussein Hi. The `"./wait-for", "mysql:3306", "--"` part I found already, what I'm looking for is the `"go", "run", "myapplication"` part, for redmine specifically. Is that what `"rails", "server", "-b", "0.0.0.0"` does? In that case, this would qualify as an answer. – Sebastien Diot Mar 09 '19 at 15:18

1 Answers1

1

You can use entrypoint keyword instead of command in your docker-compose.yml however for the issue you have with the database you don't actually need to call the entrypoint itself. You can add wait-for-it or wait-for to redmine image by extending it through using Dockerfile then in your docker-compose.yml you can use this as a command:

In case of MySQL use port 3306 or use port 5432 in case of PostgreSQL and change db word according to the database service name inside your docker-compose.yml

The rest of the command which comes after -- is based on the CMD line in redmine's Dockerfile as shown in here

command: ["./wait-for-it.sh", "db:3306", "--", "rails", "server", "-b", "0.0.0.0"]

More explanation can be found in the following answer

Mostafa Hussein
  • 11,063
  • 3
  • 36
  • 61