Skip to content

Commit

Permalink
Render.com deployment PoC (#973)
Browse files Browse the repository at this point in the history
* Render.com deployment PoC

* Setup seed data and add button
  • Loading branch information
damianlegawiec authored Sep 9, 2021
1 parent 086f11e commit 25f66a3
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@

This a dockerized [Spree Commerce](https://spreecommerce.org) application template ready to for local development and deployment to cloud providers.

## Launch on Heroku
## Deploy in the cloud

[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)

<a href="https://render.com/deploy?repo=https://github.com/spree/spree_stater">
<img src="https://render.com/images/deploy-to-render-button.svg" alt="Deploy to Render" height=32>
</a>

## Local Installation

### Using Docker (Recommended)
Expand Down
10 changes: 10 additions & 0 deletions bin/render-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
# exit on error
set -o errexit

bundle install
bundle exec rails assets:precompile
bundle exec rails assets:clean
bundle exec rails db:migrate
bundle exec rails db:seed
bundle exec rake spree_sample:load
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? || ENV['RENDER'].present?
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=31536000' }

# Compress CSS using a preprocessor.
Expand Down
18 changes: 18 additions & 0 deletions render.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
databases:
- name: spree
databaseName: spree
user: spree

services:
- type: web
name: spree
env: ruby
buildCommand: "./bin/render-build.sh"
startCommand: "bundle exec puma -C config/puma.rb"
envVars:
- key: DATABASE_URL
fromDatabase:
name: spree
property: connectionString
- key: SECRET_KEY_BASE
generateValue: true

0 comments on commit 25f66a3

Please sign in to comment.