Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

Commit

Permalink
Dockerize app
Browse files Browse the repository at this point in the history
  • Loading branch information
zhulik committed Feb 9, 2023
1 parent de200f0 commit b8dd946
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git
vendor/
spec/
.github/
coverage/
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM ruby:3.2.0-slim as base

WORKDIR /mnt

RUN adduser --system app &&\
bundle config --local path vendor/bundle &&\
bundle config set --local deployment 'true' &&\
bundle config set --local without 'development test'

RUN apt-get update &&\
apt-get install -qy --no-install-recommends git


FROM base as builder

RUN apt-get update &&\
apt-get install -qy --no-install-recommends build-essential

COPY Gemfile Gemfile.lock ./
RUN bundle install

FROM base

COPY --from=builder /mnt/vendor .

ADD . .

USER app

CMD ["bundle", "exec", "./exe/nats_streamer", "/config.yaml", "$PATH"]

0 comments on commit b8dd946

Please sign in to comment.