Skip to content

Commit

Permalink
Merge branch 'master' into hiv-aids-and-public-broadcasting-exhibit
Browse files Browse the repository at this point in the history
  • Loading branch information
ekemeyer authored Nov 15, 2024
2 parents fd535d1 + e9b16e1 commit 16a88fc
Show file tree
Hide file tree
Showing 134 changed files with 11,791 additions and 519 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
jobs:
rubocop:
name: 🤖 Check code style with Rubocop
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: 📰 Checkout code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
jobs:
specs:
name: 📋 Run Specs
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: 📰 Checkout code
Expand Down
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ jetty
# Coverage
/coverage



# ignore link check report
/spec/support/link-check-report.txt

Expand All @@ -42,3 +40,11 @@ jetty
*.csv
/*.xml
/*.pbcore

# Local Gemfiles
Gemfile.me
Gemfile.lock.me

# Local VSCode settings
.vscode

57 changes: 49 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,66 @@ WORKDIR /usr/src/app

RUN /bin/echo -e "deb http://archive.debian.org/debian stretch main\ndeb http://archive.debian.org/debian-security stretch/updates main\n" > /etc/apt/sources.list

# Install non-ruby dependencies
RUN apt update && apt install -y nodejs curl libcurl3 libcurl3-openssl-dev openjdk-8-jdk

COPY Gemfile Gemfile.lock ./
# Copy source code to container
COPY . .

RUN bundle install

############################
# Development Build Stage
############################
FROM base as development

# Set the RAILS_ENV to production. This affects several things in Rails.
ENV RAILS_ENV=development

# Update the bundle from Gemfile to pull in any newer versions not committed to
# Gemfile.lock yet.
RUN bundle update

# Install fresh jetty instance
RUN bundle exec rake jetty:clean

EXPOSE 3000

CMD rake jetty:clean && rake jetty:config && rake jetty:start && bundle exec rake db:migrate RAILS_ENV=development && bundle exec rails s -b 0.0.0.0
# Run several commmands to start the development server:
# 1. bundle exec rake jetty:config
# Copies jetty configuration from config/jetty.yml to jetty instance,
# which is installed in the 'base' build stage.
# 2. bundle exec rake jetty:start
# Starts jetty server
# 3. bundle exec rake db:migrate
# Runs databae migrations, if any need to be run.
# 4. bundle exec rails s -b 0.0.0.0
# Starts the Rails server.
CMD bundle exec rake jetty:config \
bundle exec rake jetty:start && \
bundle exec rake db:migrate && \
bundle exec rails s -b 0.0.0.0


############################
# Production Build Stage
############################
FROM base as production

# Set the RAILS_ENV to production. This affects several things in Rails.
ENV RAILS_ENV=production

# TODO: is this needed?
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

# Update the bundle from Gemfile.lock (don't update the Bundle in production)
RUN bundle install

COPY . .

RUN rake jetty:clean && rake jetty:config

CMD rake jetty:start && bundle exec rake db:migrate RAILS_ENV=development && bundle exec rails s -b 0.0.0.0
# Run commands atomically to start production AAPB web application:
# 1. bundle exec rake jetty:start
# Starts the jetty server
# 2. bundle exec rails s -b 0.0.0.0
# Starts the Rails server.
CMD bundle exec rake jetty:start && \
bundle exec rails s -b 0.0.0.0
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,4 @@ gem 'bigdecimal', '1.4.4'
gem 'httparty'

gem 'pbcore', '~> 0.2.0'
gem 'json-schema', '~> 2.8.0'
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ GEM
jquery-ui-rails (6.0.1)
railties (>= 3.2.16)
json (1.8.6)
json-schema (2.8.1)
addressable (>= 2.4)
kaminari (1.2.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.1)
Expand Down Expand Up @@ -371,6 +373,7 @@ DEPENDENCIES
jettywrapper
jquery-rails
jquery-ui-rails
json-schema (~> 2.8.0)
launchy
libv8 (~> 3.16.14.13)
maxminddb
Expand Down
Loading

0 comments on commit 16a88fc

Please sign in to comment.