Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docker deployment and hot reloading issues #356

Closed
wants to merge 10 commits into from
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ gem 'bundler-audit'
# A tagging plugin that allows for custom tagging along dynamic contexts.
gem 'acts-as-taggable-on', '~> 7.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
gem 'mini_racer', platforms: :ruby
gem 'mini_racer', '< 0.5.0', platforms: :ruby
# Bootstrap 4 ruby gem for Ruby on Rails (Sprockets) and Hanami (formerly Lotus).
gem 'bootstrap', '~> 4.5.0'
# This gem provides only Free icons from Font-Awesome.
Expand Down
11 changes: 6 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@ GEM
addressable (~> 2.7)
letter_opener (1.8.1)
launchy (>= 2.2, < 3)
libv8-node (16.10.0.0-x86_64-darwin)
libv8-node (16.10.0.0-x86_64-linux)
libv8-node (15.14.0.1-x86_64-darwin-20)
libv8-node (15.14.0.1-x86_64-darwin-21)
libv8-node (15.14.0.1-x86_64-linux)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
Expand All @@ -206,8 +207,8 @@ GEM
matrix (0.4.2)
method_source (1.0.0)
mini_mime (1.1.2)
mini_racer (0.6.2)
libv8-node (~> 16.10.0.0)
mini_racer (0.4.0)
libv8-node (~> 15.14.0.0)
minitest (5.16.0)
mocha (1.14.0)
msgpack (1.5.2)
Expand Down Expand Up @@ -411,7 +412,7 @@ DEPENDENCIES
jquery-rails
letter_opener
listen (>= 3.0.5, < 3.2)
mini_racer
mini_racer (< 0.5.0)
mocha
omniauth-google-oauth2
omniauth-rails_csrf_protection
Expand Down
2 changes: 1 addition & 1 deletion app/views/events/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<% end %>
<br />
<% if @event_partners.present? %>
<h3><%= pluralize @event_partners.count, 'Event Partner' %></h3>
<h3><%= 'Event Partner'.pluralize(@event_partners.count) %></h3>
<br />
<% @event_partners.each do |event_partner| %>
<div class="clickable_tile">
Expand Down
2 changes: 1 addition & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
config.file_watcher = ActiveSupport::FileUpdateChecker

# Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true
Expand Down
14 changes: 9 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,23 @@ version: '3.1'
services:

hackerspace3:
image: govhackau/hackerspace3
build: .
depends_on:
- postgres
env_file: .env
image: govhackau/hackerspace3
ports:
- 3000:3000
restart: always
- "3000:3000"
volumes:
- ./:/usr/src/app

postgres:
image: postgres:12.1
env_file: .env
image: postgres:12.1
ports:
- "5432:5432"
volumes:
- pg_db:/var/lib/postgresql/data
restart: always

volumes:
pg_db:
4 changes: 4 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/bin/sh
set -e

if [ -f /usr/src/app/tmp/pids/server.pid ]; then
rm /usr/src/app/tmp/pids/server.pid
fi

# Initialise Rails database if it doesn't already exist
if ! rails db:version >/dev/null 2>&1
then
Expand Down