PromucFlow_constructor/deploy
Wyatt Walter 2d21717059
fix: allow running as non-root (#40642)
## Description

Allows the Appsmith container to run as a non-root user, specified at
runtime through either docker-compose or Kubernetes pod security
context. I didn't specify the user in the `Dockerfile` because
environments like OpenShift choose a user at runtime, so it can't be
known at build time.

This needs to be followed by an update to docs and changes in the Helm
chart to finish it off, but that has a separate release cycle and this
needs to go ahead of that.

Ideally we would run as non-root by default, but since there's data
persisted on the filesystem automatically transitioning the default is
impossible without a lot of pain. This moves us in that direction and
enables it in the future if we go down that path.

Required to fix https://github.com/appsmithorg/appsmith/issues/38787

## Automation

/ok-to-test tags=""

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!WARNING]
> Tests have not run on the HEAD
50ba745c5bb7709c60ce5194437f921f1a95c980 yet
> <hr>Thu, 15 May 2025 15:56:31 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added support for user identity emulation when running as a non-root
user, improving compatibility in certain deployment environments.
- Prevented embedded database initialization when running as a non-root
user to ensure proper operation.

- **Chores**
- Installed additional system packages to the base image for enhanced
functionality.
- Optimized image size by consolidating and improving cleanup steps
during the build process.
- Updated base image and refined installation commands for improved
build consistency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-28 22:19:48 +05:30
..
ansible chore: Remove unused JSON superuser signup route (#37378) 2024-11-14 14:14:42 +05:30
aws Encoding the mongo credentials in install.sh script (#310) 2020-08-17 11:10:01 +05:30
aws_ami chore: Remove unused JSON superuser signup route (#37378) 2024-11-14 14:14:42 +05:30
digital_ocean fix: move ansible playbooks to default appsmith-ee (#29554) 2023-12-15 15:14:01 +05:30
docker fix: allow running as non-root (#40642) 2025-05-28 22:19:48 +05:30
helm fix: security update init-container for redis (#39150) 2025-02-10 14:36:37 +05:30
heroku test: Enable server tests for the PRs with base PG branch (#33429) 2024-05-22 15:55:20 +05:30
packer Packer script to build AWS and DigitalOcean images (#16617) 2022-09-14 11:03:02 +05:30