Skip to content

Dockerfile should not be root #383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aaron-junot opened this issue Oct 2, 2020 · 2 comments · Fixed by #388
Closed

Dockerfile should not be root #383

aaron-junot opened this issue Oct 2, 2020 · 2 comments · Fixed by #388

Comments

@aaron-junot
Copy link
Member

Right now, the Dockerfile runs as root because that's the default. Instead, there should be a non-root user that the uwsgi process runs as.

@Kandeel4411
Copy link
Collaborator

Kandeel4411 commented Oct 4, 2020

I think I could work on this - Also I had a minor side question about the make setup in Makefile, Is there a reason we are mostly using docker-compose run instead of docker-compose exec ?
For example, the following happens:

.PHONY: bg
bg:
	${DOCKER_COMPOSE} up --build -d   # A new db and resource container created and running

#--------------------Some other stuff------------------------------

.PHONY: setup
setup: bg
	${DOCKER_COMPOSE} run ${RESOURCES_CONTAINER} ${FLASK}  # Another new oneshot container created
	${DOCKER_COMPOSE} run ${RESOURCES_CONTAINER} ${FLASK} db-migrate create-tables  # Again
	${DOCKER_COMPOSE} run ${RESOURCES_CONTAINER} ${FLASK} db stamp head # Again
	${DOCKER_COMPOSE} run ${RESOURCES_CONTAINER} ${FLASK} db-migrate init # Again

This leads to multiple uneccessary stopped containers, if we substitute the run to exec it would utilize the already up container created by bg and would make it faster as well. Though I could be wrong so I'd love to know more!

Edit: welp nvm, platipo seems to be working on it

@aaron-junot
Copy link
Member Author

At the time, I don't think any of us realized that it wasn't using the same container. Feel free to change it to docker-compose exec and if I don't see that breaking any functionality, I'll merge. Thanks for pointing that out!

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 a pull request may close this issue.

2 participants