-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (20 loc) · 810 Bytes
/
Dockerfile
File metadata and controls
30 lines (20 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM ruby:2.7.0
LABEL maintainer="BarKeeper (Kai Müller, Sarah Wiechers)"
RUN addgroup --gid 1000 barkeeper
RUN adduser --disabled-password --gecos '' --uid 1000 --gid 1000 barkeeper
ARG PUMA_PORT
ARG RAILS_ENV
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs cmake
ENV RAILS_ROOT /var/www/barkeeper
RUN mkdir -p $RAILS_ROOT
WORKDIR $RAILS_ROOT
COPY Gemfile Gemfile
COPY Gemfile.lock Gemfile.lock
ENV BUNDLER_VERSION=2.3.5
RUN gem install rails bundler:2.3.5
RUN if [ "$RAILS_ENV" = "development" ]; then bundle config set --local without test; else bundle config set --local without test:development; fi
RUN bundle install
RUN chown -R barkeeper:barkeeper $RAILS_ROOT
RUN rails assets:precompile
EXPOSE $PUMA_PORT
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]