Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mastofe
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
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Pleroma
mastofe
Commits
d972845f
Commit
d972845f
authored
7 years ago
by
Wonderfall
Committed by
Eugen Rochko
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix #2680 - Run processes in Docker as non-root user (#3159)
parent
2c405aed
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Dockerfile
+10
-2
10 additions, 2 deletions
Dockerfile
docker_entrypoint.sh
+4
-0
4 additions, 0 deletions
docker_entrypoint.sh
with
14 additions
and
2 deletions
Dockerfile
+
10
−
2
View file @
d972845f
...
...
@@ -3,8 +3,8 @@ FROM ruby:2.4.1-alpine
LABEL
maintainer="https://github.com/tootsuite/mastodon" \
description="A GNU Social-compatible microblogging server"
ENV
RAILS_ENV=production
\
NODE_ENV=production
ENV
UID=991 GID=991
\
RAILS_ENV=production
NODE_ENV=production
EXPOSE
3000 4000
...
...
@@ -31,6 +31,8 @@ RUN echo "@edge https://nl.alpinelinux.org/alpine/edge/main" >> /etc/apk/reposit
imagemagick@edge
\
ca-certificates
\
protobuf
\
tini
\
su-exec
\
&&
npm
install
-g
npm@3
&&
npm
install
-g
yarn
\
&&
update-ca-certificates
\
&&
rm
-rf
/tmp/
*
/var/cache/apk/
*
...
...
@@ -42,4 +44,10 @@ RUN bundle install --deployment --without test development \
COPY
. /mastodon
COPY
docker_entrypoint.sh /usr/local/bin/run
RUN
chmod
+x /usr/local/bin/run
VOLUME
/mastodon/public/system /mastodon/public/assets /mastodon/public/packs
ENTRYPOINT
["/usr/local/bin/run"]
This diff is collapsed.
Click to expand it.
docker_entrypoint.sh
0 → 100644
+
4
−
0
View file @
d972845f
#!/bin/sh
addgroup
-g
${
GID
}
mastodon
&&
adduser
-h
/mastodon
-s
/bin/sh
-D
-G
mastodon
-u
${
UID
}
mastodon
find /mastodon
-path
/mastodon/public/system
-prune
-o
-not
-user
mastodon
-not
-group
mastodon
-print0
| xargs
-0
chown
-f
mastodon:mastodon
su-exec mastodon:mastodon /sbin/tini
--
"
$@
"
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