Skip to content

Commit

Permalink
Add non-root user for running uwsgi in Dockerfile (#388)
Browse files Browse the repository at this point in the history
* Add non-root user for running uwsgi in Dockerfile

* Fix PermissionError due to COPY after chown

* Bump flake8 from 3.8.3 to 3.8.4

Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.8.3 to 3.8.4.
- [Release notes](https://gitlab.com/pycqa/flake8/tags)
- [Commits](https://gitlab.com/pycqa/flake8/compare/3.8.3...3.8.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump pytest from 6.1.0 to 6.1.1

Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.1.0 to 6.1.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@6.1.0...6.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Remove log directory creation (#391)

* Remove log directory creation

* Remove unused import

* Remove rate limiting for now

* Fix volume permission overwrite

This problem seems to be already known in
docker/compose#3270 (comment)

* Fix duplicate root mkdir

* Disable pytest test caching

See pytest-dev/pytest#3557

* Add blank coverage file

* Added extra overriding of permissions command in CI config

* Added user UID

* Clean Dockerfile and revert pytest.ini

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Aaron Suarez <aaron.j.suarez1@gmail.com>
Co-authored-by: Abdelrahman Kandil <abdelrahmankandil@hotmail.com>
Co-authored-by: Aaron Suarez <aaron-suarez@users.noreply.github.com>
  • Loading branch information
5 people committed Oct 9, 2020
1 parent 9fa97f0 commit 96233c6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .circleci/config.yml
Expand Up @@ -60,6 +60,7 @@ jobs:
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > /usr/local/bin/cc-test-reporter
chmod +x /usr/local/bin/cc-test-reporter
/usr/local/bin/cc-test-reporter before-build
- run: sudo chown -R 5000 .
- run:
name: Run tests
command: |
Expand Down
6 changes: 6 additions & 0 deletions Dockerfile
Expand Up @@ -23,6 +23,12 @@ RUN poetry install --no-dev --no-interaction --no-ansi

COPY . /src

RUN useradd --no-create-home --system -s /bin/false --uid 5000 uwsgi

RUN chown -R uwsgi /src

EXPOSE 5000

USER uwsgi

CMD [ "uwsgi", "--ini", "app.ini" ]
2 changes: 1 addition & 1 deletion pytest.ini
@@ -1,2 +1,2 @@
[pytest]
addopts = -p no:warnings
addopts = -p no:warnings

0 comments on commit 96233c6

Please sign in to comment.