Skip to content

feat: improved layered dockerfile and dockerignore#2236

Open
alext-extracellular wants to merge 4 commits intofrangoteam:masterfrom
alext-extracellular:feat/dockerfile
Open

feat: improved layered dockerfile and dockerignore#2236
alext-extracellular wants to merge 4 commits intofrangoteam:masterfrom
alext-extracellular:feat/dockerfile

Conversation

@alext-extracellular
Copy link

@alext-extracellular alext-extracellular commented Mar 5, 2026

📌 Description

This PR refactors the dockerfile in order to build a much smaller image (2.4gb -> 540 MB), and to also make use of build layer caching for faster repeated builds.

The git repository is no longer cloned into the image and it is assumed it is being built from within the repo.
This allows building from different tags and branches as well, and should still work in CI.

This is needed because the image was way too large before and took ages to build.


🧪 Type of Change

Please mark the relevant option:

  • Bug fix
  • New feature
  • Refactoring
  • Documentation
  • Other

🚫 Build Artifacts Check

Please confirm:

  • I did NOT commit /client/dist
  • I did NOT commit generated Angular build output
  • Only source files are included

🔍 Checklist

  • Code follows project coding standards
  • I tested my changes locally
  • Documentation updated if required
  • Issue opened (for major changes)

📚 Documentation Checklist (if applicable)

  • The documentation builds locally with mkdocs serve
  • All links were tested
  • Images use relative paths (e.g. images/example.png)
  • No references to the old GitHub Wiki
  • Navigation updated in mkdocs.yml (if required)

📝 Additional Notes

Add any other context or screenshots here.

@unocelli
Copy link
Member

Hi @alext-extracellular Thanks for the contribution.

I tested the Docker build locally and the resulting image size is around 7.3GB, which is significantly larger than the current image (~4GB).

It seems that some large directories might still be copied into the image. Could you double-check the .dockerignore and the Dockerfile layers?

Once the image size is actually reduced we can review it again.

@alext-extracellular
Copy link
Author

Wow that is quite large, yes probably some differences in what is in our personal repos, I will try to fix that.
Here is my built image:

frangoteam/fuxa:testsmall4                             6494f4d4f340        578MB             0B

Here is a depth 2 tree of my repo:

.
├── app
│   └── electron
├── client
│   ├── dist
│   ├── e2e
│   ├── node_modules
│   ├── src
│   ├── angular.json
│   ├── bs-config.json
│   ├── package-lock.json
│   ├── package.json
│   ├── proxy.conf.json
│   └── tsconfig.json
├── docs
│   ├── assets
│   ├── images
│   ├── Getting-Started.md
│   ├── HowTo-animate-Pipe.md
│   ├── HowTo-bind-Controls.md
│   ├── HowTo-bind-Shapes.md
│   ├── HowTo-Chart-Control.md
│   ├── HowTo-configure-events.md
│   ├── HowTo-configure-Script.md
│   ├── HowTo-define-Shapes.md
│   ├── HowTo-Devices-and-Tags.md
│   ├── HowTo-Node-Red.md
│   ├── HowTo-ODBC.md
│   ├── HowTo-save-load-Project.md
│   ├── HowTo-Scheduler.md
│   ├── HowTo-setup-Alarms.md
│   ├── HowTo-UI-Layout.md
│   ├── HowTo-use-same-view.md
│   ├── HowTo-View.md
│   ├── HowTo-WebSockets.md
│   ├── HowTo-Widgets.md
│   ├── index.md
│   ├── Installing-and-Running.md
│   ├── Settings.md
│   └── Tips-and-Tricks.md
├── node-red
│   └── node-red-contrib-fuxa
├── node_modules
│   ├── @serialport
│   ├── async-mutex
│   └── tslib
├── odbc
│   ├── install_odbc_drivers.sh
│   └── odbcinst.ini
├── screenshot
│   ├── feature-action-move.gif
│   ├── fuxa-device.gif
│   ├── fuxa-editor.png
│   ├── fuxa-hmi.gif
│   ├── fuxa-home.png
│   ├── fuxa-test.gif
│   └── fuxa-thinglinks.gif
├── server
│   ├── _images
│   ├── _widgets
│   ├── api
│   ├── dist
│   ├── docs
│   ├── integrations
│   ├── node_modules
│   ├── runtime
│   ├── test
│   ├── envParams.js
│   ├── fuxa.js
│   ├── main.js
│   ├── package-lock.json
│   ├── package.json
│   ├── paths.js
│   ├── project.default.json
│   ├── project.demo.fuxap
│   ├── settings.default.js
│   └── tsconfig.json
├── bakDockerfile
├── betterfile
├── CHANGES.md
├── compose.yml
├── CONNECTION_MANAGER.md
├── CONTRIBUTING.md
├── Dockerfile
├── LICENSE
├── mkdocs.yml
├── modbus-rewrite.md
├── package-lock.json
├── package.json
├── README.md
├── SECURITY.md
└── TAG_LEVEL_SLAVE_ID_IMPLEMENTATION.md

@unocelli If you can, it would be handy to see a tree of ur repo

@alext-extracellular
Copy link
Author

alext-extracellular commented Mar 13, 2026

OK, I have updated the dockerfile and dockerignore. I have tested by cloning a fresh repo and running the build, the output is below:

frangoteam/fuxa:latest        3701395eae46       1.43GB             0B   U
fuxa_test:latest              91ef9e2de901        587MB             0B

Make sure you are using the .dockerignore, otherwise some large stuff might get copied into the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants