Please could we allow for a custom dockerfile to be used during build? Maybe we could specify the custom dockerfile in the target settings? We don't like to run our containers as root and Wappler defaults to this which is terrible practice. We can't edit the dockerfile as it gets overwritten at build. Even if the following example configuration could be added by default it would be a great security update...
# Create a non-root user and group
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
# Change ownership of app directory to the new user
RUN chown -R appuser:appgroup /opt/node_app
# Ensure appuser owns all copied files
RUN chown -R appuser:appgroup /opt/node_app
# Switch to non-root user
USER appuser
Are you referring to Dockerfile under web folder or docker-compose.yml or both?
I would love to see customisation options in both files, that aren't overwritten when project targets are saved. I have raised the issue of docker config and yml files being overwritten in some of my posts in the past and how it can impact the running of a docker project if these overwritten changes aren't reverted or verified before re-deployments.
I create a different sudo user on the remote hosts, so adding a default user may not work for everyone.
I find that docker-compose.yml remains intact and is not overwritten so for us that is not an issue but would still be nice to have total control over breaking out of the defaults, especially those which are enforced by Wappler.
We do the same and create our own User for our containers. So maybe just allow for us, the User, to use our own dockerfile rather than populate them with defaults, maybe dockerfile.prod or something similar (as locally we don't really care if we run as root). In hindsight that is probably the better option so agree with you entirely @guptast
As always really do appreciate your input. I hope we can get some traction on this. Thank you.