Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# If you mix and match using Docker and manually setting stuff up, you could end up with a Gemfile.lock
# In the Docker container, we want to have `bundle install` rebuild the Gemfile.lock to match the Ruby version
# and stuff in the Dockerfile, so to be safe we just tell the container build to ignore that file and not
# COPY or ADD it to the container b/c it's hard to troubleshoot build errors when this happens
Gemfile.lock
# Nothing yet. Let's keep the outside and inside the same. If we start running into things that are
# generated inside the container during the build that we want isolated from the outside, we can
# add them here to be ignored. Just keep in mind that the whole root app is mounted as a volume,
# so at runtime, the container will have what's on the outside. This file only affects buildtime.
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN echo "deb [check-valid-until=no] http://archive.debian.org/debian jessie-bac
RUN sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list

# Note: gettext is installed to be able to use envsubst to inject config values
RUN apt-get -o Acquire::Check-Valid-Until=false update -qq && apt-get install -y build-essential libpq-dev gettext
RUN apt-get -o Acquire::Check-Valid-Until=false update -qq && apt-get install -y build-essential libpq-dev gettext vim

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😭 Thank you for this!


# The rubycas Gemfile / gemspec doesn't specify a rails version since we use Apache Passenger modrails to run it in prod.
# Need this installed in the container to run the dev version.
Expand All @@ -18,12 +18,10 @@ RUN mkdir /app
WORKDIR /app
# Note: in .dockerignore we exclude Gemfile.lock b/c we want bundle install to regenerate it for
# this version of Ruby. It doesn't get copied over to the container if you have one laying around from a non-Docker build.
ADD Gemfile /app/Gemfile
ADD rubycas-server.gemspec /app/rubycas-server.gemspec
COPY Gemfile /app/Gemfile
COPY rubycas-server.gemspec /app/rubycas-server.gemspec
RUN bundle install

# Do this after bundle install b/c if we do it before then changing any files
# causes bundle install to be invalidated and run again on the next build
ADD . /app


COPY . /app
17 changes: 10 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3"
version: "3.5"
services:

ssoweb:
Expand All @@ -7,9 +7,11 @@ services:
command: /app/docker-compose/scripts/docker_compose_run.sh
ports:
- "3002:3002"
# Make changes done outside the container reflect inside the container without needing a rebuild by mounting a volume.
volumes:
- .:/app
networks:
- frontend
- beyondz-platform_frontend
- bravendev
depends_on:
- ssodb
environment:
Expand All @@ -24,14 +26,15 @@ services:
volumes:
- sso-db:/var/lib/postgresql/data
networks:
- frontend
- bravendev
environment:
POSTGRES_DB: casserver

# Note all Braven web app docker dev envs use this same network so they can talk to each other.
# E.g. the hostname joinweb will resolve inside the ssoweb container if they are on the same docker network.
networks:
frontend:
beyondz-platform_frontend:
external: true
bravendev:
name: braven_dev_network

volumes:
sso-db:
3 changes: 0 additions & 3 deletions docker-compose/scripts/docker_compose_run.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash

#sleep 15s until db is up and running
sleep 15

# Take the environment variables setup in docker-compose.yml and inject their values
# into the actual application config.yml file. Note: envsubst needs gettext to be installed.
envsubst < /app/docker-compose/config/config.yml > /app/config/config.yml
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/scripts/rebuild.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
docker-compose down -v
docker-compose down
docker-compose up -d --force-recreate --build
2 changes: 1 addition & 1 deletion docker-compose/scripts/restart.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
docker-compose down -v
docker-compose down
docker-compose up -d
1 change: 1 addition & 0 deletions rubycas-server.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ $gemspec = Gem::Specification.new do |s|
s.add_development_dependency("appraisal", "~> 0.4.1")
s.add_development_dependency("guard", "~> 1.4.0")
s.add_development_dependency("guard-rspec", "2.0.0")
s.add_development_dependency("public_suffix", "3.1.1") # Newer versions require Ruby 2.3 or higher. This is a dependency of webmock below (through addressable), so pin it to last version that supports ruby 2.1.
s.add_development_dependency("webmock", "~> 1.8")
s.add_development_dependency("nokogiri", "1.6.3.1")

Expand Down