Question - ineffective build of docker images, effective scaling is not possible

Hi i have been reviewing the docker-compose file, and it includes a lot of ineffective file mappings that are not allowing for scaling and makes deployment using non-cli managment tools impossible…

    volumes:
      - ./apache/ssl/mycert.crt:/etc/ssl/certs/mycert.crt
      - ./apache/ssl/mycert.key:/etc/ssl/private/mycert.key
      - ./apache/vhost-ssl.conf:/etc/apache2/sites-available/000-default.conf
      - ./crontab/crontab:/etc/cron.d/eramba-crontab

these files could easily be included in the image build process, so you won’t need to have them on the local filesystem.

it also seems redundant that you have configured environment variables, but still require a .env file…
Preferably environment variables should be handled as Secrets (e.g. DB_PASSWORD_FILE: “/run/secrets/db_pass”)

it would render a much simpler compose file, and allow for much more flexible deployment.

hope this makes sense

Kind regards
Jonas

Hello,

the root folder of any eramba application includes a Dockerfile that is always used to build that version from. When you open it youll see that all of those files are already included within each image. The mappings are there for people to be able to customize some key parts when running it themselves, like certificates for apache.

Currently we are not planning to change the way environmental values are implemented, if you feel you want to contribute, you can submit a pull request at our GitHub - eramba/docker: Docker helper files for running eramba software repository with your proposed changes.

Martin

I reviewed the dockerfile, and found a few things:

This isn’t included in the build actually:
docker-cron-entrypoint.sh
Considering it is used as the entrypoint for the cron container, this should be included.
this file(from git) is also different from the file located inside the image /var/www/eramba/docker/ so this cannot be used as substitute.

it would also be best practice to clean up the Apt cache to reduce the imagesize

Ok, im adding the docker-cron-entrypoint.sh into the docker image build for 3.19.0. Also im modifying simple install to specifically use this file as an entrypoint to the Cron container as per this commit.
That PR also contains some significant updates that will take effect when we release 3.19.0.

Martin

1 Like

Cool - thanks!

It really helps me with my deployment in a HA(swarm) environment.
looking forward to that release :slight_smile:

/Jonas