Skip to content

Commit

Permalink
Merge branch 'develop' into bulk_upload_sample_size_1
Browse files Browse the repository at this point in the history
  • Loading branch information
robkooper committed Jun 3, 2020
2 parents b2d8e08 + b2960a4 commit d2068a6
Show file tree
Hide file tree
Showing 17 changed files with 352 additions and 233 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Expand Up @@ -4,3 +4,4 @@ log/*
tmp/*
public/maps/*
vendor
initdb/db.dump
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -25,3 +25,6 @@ docker-compose.override.yaml

# Ignore encrypted secrets key file.
config/secrets.yml.key

# Ignore db dump
initdb/db.dump
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -19,7 +19,11 @@ In this case you can simply pull down the version you want, and run `docker-comp

## [Unreleased]

### Fixes
- Fixes to the docker build to fit in kubernetes helm chart.

### Changed
- updated rails to 5.1.7
- removed static route, it was only used to render 404.
- allow n=1 in bulk upload https://github.com/PecanProject/bety/pull/704

Expand Down
78 changes: 44 additions & 34 deletions Dockerfile
@@ -1,36 +1,5 @@
FROM ruby:2.3
MAINTAINER Max Burnette <mburnet2@illinois.edu>

# Install dependencies
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
curl \
git \
libgeos-dev \
netcat \
nodejs \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*

# change to working directory
WORKDIR /home/bety

# install gems (allowing for caching)
COPY /Gemfile* /home/bety/
RUN gem install bundler \
&& bundle install --with docker --without "test development production debug javascript_testing"


# port that is exposed (standard ruby port)
EXPOSE 8000

# copy rest of the files
COPY / /home/bety
COPY /docker/database.yml /home/bety/config/database.yml
COPY /docker/config.ru /home/bety/config.ru

# configure app
RUN /bin/sed -e '/serve_static_assets/ s/false$/true/' -i config/environments/production.rb
LABEL maintainer="Max Burnette <mburnet2@illinois.edu>, Rob Kooper <kooper@illinois.edu>"

# arguments that are added at the bottom of BETY
ARG BETY_GIT_TAGS="unknown"
Expand All @@ -51,10 +20,51 @@ ENV LOCAL_SERVER=99 \
BETY_GIT_TAGS=${BETY_GIT_TAGS} \
BETY_GIT_BRANCH=${BETY_GIT_BRANCH} \
BETY_GIT_CHECKSUM=${BETY_GIT_CHECKSUM} \
BETY_GIT_DATE=${BETY_GIT_DATE}
BETY_GIT_DATE=${BETY_GIT_DATE} \
PGHOST=postgres \
PGUSER=postgres \
PGDATABASE=postgres \
BETYUSER=bety \
BETYPASSWORD=bety \
BETYDATABASE=bety

# Install dependencies
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
curl \
git \
libgeos-dev \
netcat \
nodejs \
postgresql-client \
&& rm -rf /var/lib/apt/lists/* \
&& useradd -m -u 1000 -s /bin/bash bety

# change to working directory
USER bety
WORKDIR /home/bety

# install gems (allowing for caching)
COPY --chown=bety /Gemfile* /home/bety/
RUN gem install bundler -v 1.17.3 \
&& bundle config path vendor/bundle \
&& bundle config without 'test development production debug javascript_testing' \
&& bundle config with 'docker' \
&& bundle install --jobs 4 --retry 3

# copy rest of the files
COPY --chown=bety / /home/bety
COPY --chown=bety /docker/database.yml /home/bety/config/database.yml
COPY --chown=bety /docker/config.ru /home/bety/config.ru

# configure app
RUN /bin/sed -e '/serve_static_assets/ s/false$/true/' -i config/environments/production.rb

# expose public files
VOLUME ["/home/bety/public"]
VOLUME ["/home/bety/log"]

# port that is exposed
EXPOSE 8000

# default command to run bety web-app
ENTRYPOINT ["/home/bety/docker/entrypoint.sh"]
Expand Down
11 changes: 4 additions & 7 deletions Gemfile
@@ -1,6 +1,6 @@
source "http://rubygems.org"

gem "rails", "5.1.5"
gem "rails", "5.1.7"
# needed for rails 3.1 and above until we phase out prototype:
## gem 'prototype-rails', github: 'rails/prototype-rails', branch: '4.2' # see https://github.com/rails/prototype-rails/issues/37
gem "nokogiri"
Expand Down Expand Up @@ -45,7 +45,7 @@ gem "pg"
gem "activerecord-postgis-adapter"


gem "trollop" # for Rails scripts
gem "optimist" # for Rails scripts


group :development, :test do
Expand All @@ -56,11 +56,6 @@ group :development, :test do
gem "yard"
end

group :development, :test do
gem "pry-rails"
gem "pry-byebug"
end

group :test do
# phasing out webrat:
# gem "webrat", "0.7.1"
Expand All @@ -83,6 +78,8 @@ end
group :debug do
gem "selenium-webdriver"
gem "pry"
gem "pry-rails"
gem "pry-byebug"
end

group :production do
Expand Down

0 comments on commit d2068a6

Please sign in to comment.