Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run Docker container with a specific user.
Pass --user (`DOCKER_USER`) attribute when creating the container. This has no effect in production since we are using the same user and group than the one defined inside the Dockerfile image (docs:docs). Although, this allow us to avoid permissions conflicts when running the build with Docker locally (development) since we can pass our current user. That way, every file created/modified inside the container will be done using the current UID and GID defined by the developer. This can be done as, local_settings.py DOCKER_USER = f'{os.geteuid()}:{os.getegid()}' With this change, there is no need to re-build the Docker image used in production with our own custom `USER` instruction. https://docs.docker.com/engine/reference/run/#user Co-authored-by: Raúl Cumplido <raulcumplido@gmail.com>
- Loading branch information