Skip to content

Commit 96233c6

Browse files
platipodependabot-preview[bot]Aaron SuarezKandeel4411Aaron Suarez
authored
Add non-root user for running uwsgi in Dockerfile (#388)
* 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] <[email protected]> * 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] <[email protected]> * 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 <[email protected]> Co-authored-by: Abdelrahman Kandil <[email protected]> Co-authored-by: Aaron Suarez <[email protected]>
1 parent 9fa97f0 commit 96233c6

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.circleci/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ jobs:
6060
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > /usr/local/bin/cc-test-reporter
6161
chmod +x /usr/local/bin/cc-test-reporter
6262
/usr/local/bin/cc-test-reporter before-build
63+
- run: sudo chown -R 5000 .
6364
- run:
6465
name: Run tests
6566
command: |

Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ RUN poetry install --no-dev --no-interaction --no-ansi
2323

2424
COPY . /src
2525

26+
RUN useradd --no-create-home --system -s /bin/false --uid 5000 uwsgi
27+
28+
RUN chown -R uwsgi /src
29+
2630
EXPOSE 5000
2731

32+
USER uwsgi
33+
2834
CMD [ "uwsgi", "--ini", "app.ini" ]

pytest.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[pytest]
2-
addopts = -p no:warnings
2+
addopts = -p no:warnings

0 commit comments

Comments
 (0)