Docker Compose setup compatible with foreman-installer

I’m trying to create a Docker Compose setup, which is fully compatible with the foreman-installer (say, with the default options).

The foreman-docker-compose project is pretty close, but trying to use the foreman-rake command I noticed that the setup resulting from a foreman-installer run differs. Looking at the “foreman-rake” script I noticed that a foreman user is assumed to be installed and the application (obviously) doesn’t run as root (as in Docker, currently).

Can someone help me find the appropriate pieces of the foreman-installer and/or the foreman that help me derive a default setup that is matching? Any hints and constructive ideas are appreciated!

P.S.: You may want to consult my feature branch to get an idea of the current setup.

can you reuse the containers from https://quay.io/organization/foreman ?

Aha, interesting. Where is the source code for these images?

https://github.com/theforeman/forklift/tree/master/containers/images

1 Like

Congratulations on the progress on the topic! (I saw this mentioned in a related thread.)

The Docker Compose file in the foreman repo references both the container image from Quay as well as the build context.

    image: quay.io/foreman/foreman:develop
    command: bundle exec bin/rails server -b 0.0.0.0
    build:
      context: .

So, this setup is clearly meant for developing The Foreman, correct?

Should we split up the Compose configuration into separate files, e.g. by moving the development pieces into a docker-compose.override.yml file (as suggested by the Docker documentation)?

This way we could make the picture clearer, separate the concerns of the application architecture + dependencies and development. This could help to keep a suggested reference implementation for a base setup in a single file. We could then add a Kubernetes configuration mirroring that setup (that we would have to keep aligned).

What do you think?


Full disclosure and background information: My motivation here is to have a single file or small set of configuration files that are “production ready” (labeled “The Foreman certified”:tm:) that one could curl or wget w/o having to clone the entire repository, for setup automation freed of any manual tasks.