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

**URL:** https://discussions.eramba.org/t/question-ineffective-build-of-docker-images-effective-scaling-is-not-possible/2687
**Category:** Forum - Installation
**Created:** [January 26, 2023, 12:30pm UTC](https://discussions.eramba.org/t/question-ineffective-build-of-docker-images-effective-scaling-is-not-possible/2687 "2023-01-26T12:30:54Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jonas.von.scholten](https://discussions.eramba.org/user_avatar/discussions.eramba.org/jonas.von.scholten/32/349_2.png) [@jonas.von.scholten](https://discussions.eramba.org/u/jonas.von.scholten)
#### Post date: [January 26, 2023, 12:30pm UTC](https://discussions.eramba.org/t/question-ineffective-build-of-docker-images-effective-scaling-is-not-possible/2687/1 "2023-01-26T12:30:54Z")

</div>

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…

```auto
    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

---

<div class="post-metadata">

### Author: ![martin](https://discussions.eramba.org/letter_avatar_proxy/v4/letter/m/73ab20/32.png) [@martin](https://discussions.eramba.org/u/martin)
#### Post date: [February 6, 2023, 1:14pm UTC](https://discussions.eramba.org/t/question-ineffective-build-of-docker-images-effective-scaling-is-not-possible/2687/2 "2023-02-06T13:14:14Z")

</div>

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](https://github.com/eramba/docker) repository with your proposed changes.

Martin

---

<div class="post-metadata">

### Author: ![jonas.von.scholten](https://discussions.eramba.org/user_avatar/discussions.eramba.org/jonas.von.scholten/32/349_2.png) [@jonas.von.scholten](https://discussions.eramba.org/u/jonas.von.scholten)
#### Post date: [February 7, 2023, 11:18am UTC](https://discussions.eramba.org/t/question-ineffective-build-of-docker-images-effective-scaling-is-not-possible/2687/3 "2023-02-07T11:18:02Z")

</div>

> [@martin](#):
>
> hose files are already included within each image.

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

---

<div class="post-metadata">

### Author: ![martin](https://discussions.eramba.org/letter_avatar_proxy/v4/letter/m/73ab20/32.png) [@martin](https://discussions.eramba.org/u/martin)
#### Post date: [February 7, 2023, 12:35pm UTC](https://discussions.eramba.org/t/question-ineffective-build-of-docker-images-effective-scaling-is-not-possible/2687/4 "2023-02-07T12:35:59Z")

</div>

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](https://github.com/eramba/docker/pull/42/commits/3430999435ee02aceb08c4f4775ab582a1d13c71).  
That PR also contains some significant updates that will take effect when we release 3.19.0.

Martin

---

<div class="post-metadata">

### Author: ![jonas.von.scholten](https://discussions.eramba.org/user_avatar/discussions.eramba.org/jonas.von.scholten/32/349_2.png) [@jonas.von.scholten](https://discussions.eramba.org/u/jonas.von.scholten)
#### Post date: [February 7, 2023, 12:57pm UTC](https://discussions.eramba.org/t/question-ineffective-build-of-docker-images-effective-scaling-is-not-possible/2687/5 "2023-02-07T12:57:48Z")

</div>

> [@martin](#):
>
> nt updates that will take effect when we release 3.19.0.

Cool - thanks!

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

/Jonas
