Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Portal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fachschaft
Portal
Commits
166bf4fa
Verified
Commit
166bf4fa
authored
5 months ago
by
Sören Ducati
Browse files
Options
Downloads
Patches
Plain Diff
changed docker image so it runs as non root user
parent
e83161a3
No related branches found
Branches containing commit
No related tags found
1 merge request
!26
Drop root privileges in container
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Dockerfile
+2
-3
2 additions, 3 deletions
Dockerfile
with
2 additions
and
3 deletions
Dockerfile
+
2
−
3
View file @
166bf4fa
...
...
@@ -5,8 +5,7 @@ WORKDIR /app
EXPOSE
5000
# First, copy and install only the requirements...
RUN
useradd
-ms
/bin/bash python
USER
python
RUN
useradd
-ms
/bin/bash python
&&
chown
-R
python:python /app
RUN
pip
install
--upgrade
pip setuptools
RUN
pip
install
pipenv
COPY
Pipfile.lock .
...
...
@@ -15,7 +14,7 @@ RUN pip uninstall --yes pipenv
RUN
pip
install
-r
requirements.txt
# ... then the rest of the application. This allows the installation stage to be cached most of the time
# (so we don't have reinstall of all dependencies every time the container is rebuilt)
COPY
. .
COPY
--chown=python:python
. .
FROM
base
AS
dev
ENV
SERVER_TYPE=flask
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment