Skip to content

Commit 24c83f8

Browse files
author
Keith Thompson
authored
Merge pull request #11 from coderjourney/deploy-application
Prep application for deployment
2 parents 6212cba + 1645ffa commit 24c83f8

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@
1515

1616
# Ignore Byebug command history file.
1717
.byebug_history
18+
19+
# Never store production env file
20+
.env.prod

config/environments/production.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020

2121
# Compress JavaScripts and CSS.
2222
config.assets.js_compressor = :uglifier
23-
# config.assets.css_compressor = :sass
23+
config.assets.css_compressor = :sass
2424

2525
# Do not fallback to assets pipeline if a precompiled asset is missed.
26-
config.assets.compile = false
26+
config.assets.compile = ENV['RAILS_SERVE_STATIC_FILES'].present?
2727

2828
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
2929

docker-compose.prod.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: "2"
2+
3+
volumes:
4+
db-data:
5+
external: false
6+
7+
services:
8+
prod_db:
9+
image: postgres
10+
env_file: .env.prod
11+
volumes:
12+
- db-data:/var/lib/postgresql/db-data
13+
14+
prod_app:
15+
build: .
16+
env_file: .env.prod
17+
ports:
18+
- "3000:3000"
19+
depends_on:
20+
- prod_db

script/start

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
#!/bin/sh
2-
rm /tmp/puma.pid
2+
3+
if [[ -a /tmp/puma.pid ]]; then
4+
rm /tmp/puma.pid
5+
fi
6+
37
rails server -b 0.0.0.0 -P /tmp/puma.pid

0 commit comments

Comments
 (0)