1- FROM ruby:2.3
2- MAINTAINER Max Burnette <mburnet2@illinois.edu>
3-
4- # Install dependencies
5- RUN apt-get update \
6- && apt-get install --no-install-recommends -y \
7- curl \
8- git \
9- libgeos-dev \
10- netcat \
11- nodejs \
12- postgresql-client \
13- && rm -rf /var/lib/apt/lists/*
14-
15- # change to working directory
16- WORKDIR /home/bety
17-
18- # install gems (allowing for caching)
19- COPY /Gemfile* /home/bety/
20- RUN gem install bundler \
21- && bundle install --with docker --without "test development production debug javascript_testing"
22-
23-
24- # port that is exposed (standard ruby port)
25- EXPOSE 8000
26-
27- # copy rest of the files
28- COPY / /home/bety
29- COPY /docker/database.yml /home/bety/config/database.yml
30- COPY /docker/config.ru /home/bety/config.ru
31-
32- # configure app
33- RUN /bin/sed -e '/serve_static_assets/ s/false$/true/' -i config/environments/production.rb
1+ FROM ruby:2.6
2+ LABEL maintainer="Max Burnette <mburnet2@illinois.edu>, Rob Kooper <kooper@illinois.edu>"
343
354# arguments that are added at the bottom of BETY
365ARG BETY_GIT_TAGS="unknown"
@@ -51,10 +20,51 @@ ENV LOCAL_SERVER=99 \
5120 BETY_GIT_TAGS=${BETY_GIT_TAGS} \
5221 BETY_GIT_BRANCH=${BETY_GIT_BRANCH} \
5322 BETY_GIT_CHECKSUM=${BETY_GIT_CHECKSUM} \
54- BETY_GIT_DATE=${BETY_GIT_DATE}
23+ BETY_GIT_DATE=${BETY_GIT_DATE} \
24+ PGHOST=postgres \
25+ PGUSER=postgres \
26+ PGDATABASE=postgres \
27+ BETYUSER=bety \
28+ BETYPASSWORD=bety \
29+ BETYDATABASE=bety
30+
31+ # Install dependencies
32+ RUN apt-get update \
33+ && apt-get install --no-install-recommends -y \
34+ curl \
35+ git \
36+ libgeos-dev \
37+ netcat \
38+ nodejs \
39+ postgresql-client \
40+ && rm -rf /var/lib/apt/lists/* \
41+ && useradd -m -u 1000 -s /bin/bash bety
42+
43+ # change to working directory
44+ USER bety
45+ WORKDIR /home/bety
46+
47+ # install gems (allowing for caching)
48+ COPY --chown=bety /Gemfile* /home/bety/
49+ RUN gem install bundler -v 1.17.3 \
50+ && bundle config path vendor/bundle \
51+ && bundle config without 'test development production debug javascript_testing' \
52+ && bundle config with 'docker' \
53+ && bundle install --jobs 4 --retry 3
54+
55+ # copy rest of the files
56+ COPY --chown=bety / /home/bety
57+ COPY --chown=bety /docker/database.yml /home/bety/config/database.yml
58+ COPY --chown=bety /docker/config.ru /home/bety/config.ru
59+
60+ # configure app
61+ RUN /bin/sed -e '/serve_static_assets/ s/false$/true/' -i config/environments/production.rb
5562
5663# expose public files
57- VOLUME ["/home/bety/public" ]
64+ VOLUME ["/home/bety/log" ]
65+
66+ # port that is exposed
67+ EXPOSE 8000
5868
5969# default command to run bety web-app
6070ENTRYPOINT ["/home/bety/docker/entrypoint.sh" ]
0 commit comments