Skip to content

Commit

Permalink
updating container to run as a non root user
Browse files Browse the repository at this point in the history
  • Loading branch information
rlakey committed Oct 5, 2023
1 parent 9a0f973 commit 4750567
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.7
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/ruby:2.7

RUN curl -sS https://deb.nodesource.com/setup_16.x | bash -
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
Expand All @@ -17,4 +17,8 @@ RUN bundle install --without development test
ADD . $APP_HOME
RUN yarn install --check-files --production
RUN SECRET_KEY_BASE=none NODE_ENV=production bundle exec rake assets:precompile

RUN chown -R 1000:2000 /app
USER 1000

CMD ["rails","server","-b","0.0.0.0"]

0 comments on commit 4750567

Please sign in to comment.