mirror of
https://github.com/standardnotes/app.git
synced 2026-01-11 19:56:41 +00:00
fix: run Docker without root
This commit is contained in:
parent
91637fd6ab
commit
62da387d3a
1 changed files with 12 additions and 3 deletions
15
Dockerfile
15
Dockerfile
|
|
@ -1,5 +1,10 @@
|
|||
FROM ruby:2.7.1-alpine
|
||||
|
||||
ARG UID=1000
|
||||
ARG GID=1000
|
||||
|
||||
RUN addgroup -S webapp -g $GID && adduser -D -S webapp -G webapp -u $UID
|
||||
|
||||
RUN apk add --update --no-cache \
|
||||
alpine-sdk \
|
||||
nodejs \
|
||||
|
|
@ -10,15 +15,19 @@ RUN apk add --update --no-cache \
|
|||
|
||||
WORKDIR /app/
|
||||
|
||||
COPY package.json package-lock.json Gemfile Gemfile.lock /app/
|
||||
RUN chown -R $UID:$GID .
|
||||
|
||||
COPY vendor /app/vendor
|
||||
USER webapp
|
||||
|
||||
COPY --chown=$UID:$GID package.json package-lock.json Gemfile Gemfile.lock /app/
|
||||
|
||||
COPY --chown=$UID:$GID vendor /app/vendor
|
||||
|
||||
RUN npm ci
|
||||
|
||||
RUN gem install bundler && bundle install
|
||||
|
||||
COPY . /app/
|
||||
COPY --chown=$UID:$GID . /app/
|
||||
|
||||
RUN npm run bundle
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue