Skip to content

Commit 74b073c

Browse files
committed
Adding render files
1 parent a2db7f8 commit 74b073c

File tree

15 files changed

+9988
-9
lines changed

15 files changed

+9988
-9
lines changed

.devcontainer/Dockerfile

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,30 @@ RUN curl -sSLo doctl.tar.gz https://github.com/digitalocean/doctl/releases/downl
3434
&& tar xf doctl.tar.gz \
3535
&& sudo mv doctl /usr/local/bin
3636

37+
# Install Heroku CLI
38+
RUN curl https://cli-assets.heroku.com/install.sh | sudo sh
39+
40+
3741
# Install GH cli
3842
RUN export DEBIAN_FRONTEND=noninteractive \
3943
&& sudo apt-get update \
4044
&& sudo apt -y install --no-install-recommends software-properties-common \
4145
&& sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 \
4246
&& sudo apt-add-repository https://cli.github.com/packages \
4347
&& sudo apt-get update \
44-
&& sudo apt-get -y install --no-install-recommends gh
48+
&& sudo apt-get -y install --no-install-recommends gh
49+
50+
# Install phantomjs
51+
RUN apt-get update \
52+
&& apt-get install -y --no-install-recommends \
53+
ca-certificates \
54+
bzip2 \
55+
libfontconfig \
56+
&& apt-get clean \
57+
&& rm -rf /var/lib/apt/lists/*
58+
59+
RUN mkdir /tmp/phantomjs \
60+
&& curl -L https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 \
61+
| tar -xj --strip-components=1 -C /tmp/phantomjs \
62+
&& cd /tmp/phantomjs \
63+
&& mv bin/phantomjs /usr/local/bin

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ gem 'bootsnap', '>= 1.4.4', require: false
3131
group :development, :test do
3232
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
3333
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
34+
gem 'poltergeist'
3435
end
3536

3637
group :development do

Gemfile.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ GEM
7676
regexp_parser (>= 1.5, < 3.0)
7777
xpath (~> 3.2)
7878
childprocess (3.0.0)
79+
cliver (0.3.2)
7980
concurrent-ruby (1.1.8)
8081
crass (1.0.6)
8182
erubi (1.10.0)
@@ -107,6 +108,10 @@ GEM
107108
mini_portile2 (~> 2.5.0)
108109
racc (~> 1.4)
109110
pg (1.2.3)
111+
poltergeist (1.18.1)
112+
capybara (>= 2.1, < 4)
113+
cliver (~> 0.3.1)
114+
websocket-driver (>= 0.2.0)
110115
public_suffix (4.0.6)
111116
puma (5.2.0)
112117
nio4r (~> 2.0)
@@ -210,6 +215,7 @@ DEPENDENCIES
210215
jbuilder (~> 2.7)
211216
listen (~> 3.3)
212217
pg (~> 1.1)
218+
poltergeist
213219
puma (~> 5.0)
214220
rack-mini-profiler (~> 2.0)
215221
rails (~> 6.1.1)

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,13 @@ This is a [Ruby on Rails](https://rubyonrails.org/) blog that connects to a Rail
2424
This app was generated with the `rails new` command and following the getting
2525
[getting started](https://guides.rubyonrails.org/getting_started.html) guide.
2626
Read more about Rails on their [official website](https://rubyonrails.org/)
27+
28+
29+
## Local Dev Setup
30+
Had to run export RAILS_ENV=test && bin/rails db:prepare in order to get my test database setup to run tests. Would be nice if this just happend when I run the test command
31+
32+
Testing - https://edgeapi.rubyonrails.org/classes/ActionDispatch/SystemTestCase.html
33+
34+
35+
## Render
36+
https://render.com/docs/deploy-rails#update-your-app-for-render

bin/render-build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
# exit on error
3+
set -o errexit
4+
5+
bundle install
6+
bundle exec rake assets:precompile
7+
bundle exec rake assets:clean
8+
bundle exec rake db:migrate

config/database.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ development:
5757
# Do not set this db to the same as development or production.
5858
test:
5959
<<: *default
60-
url: <%= ENV['DATABASE_URL'] %>
60+
url: <%= ENV['DATABASE_URL'] + "_test" %>
6161

6262
# As with config/credentials.yml, you never want to store sensitive information,
6363
# like your database password, in your source code. If your source code is

config/environments/production.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
# Disable serving static files from the `/public` folder by default since
2424
# Apache or NGINX already handles this.
25-
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
25+
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? || ENV['RENDER'].present?
2626

2727
# Compress CSS using a preprocessor.
2828
# config.assets.css_compressor = :sass

config/puma.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@
3030
# Workers do not work on JRuby or Windows (both of which do not support
3131
# processes).
3232
#
33-
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
33+
workers ENV.fetch("WEB_CONCURRENCY") { 2 }
3434

3535
# Use the `preload_app!` method when specifying a `workers` number.
3636
# This directive tells Puma to first boot the application and load code
3737
# before forking the application. This takes advantage of Copy On Write
3838
# process behavior so workers use less memory.
3939
#
40-
# preload_app!
40+
preload_app!
4141

4242
# Allow puma to be restarted by `rails restart` command.
4343
plugin :tmp_restart

0 commit comments

Comments
 (0)