Updated docker config
This commit is contained in:
parent
ae76d41903
commit
aed9ac9fd5
@ -11,6 +11,11 @@ RUN rm /etc/nginx/sites-enabled/default
|
||||
ADD docker/nginx_server.conf /etc/nginx/sites-enabled/parsley.conf
|
||||
ADD docker/nginx_env.conf /etc/nginx/main.d/env.conf
|
||||
|
||||
# Add DB Migration Script
|
||||
RUN mkdir -p /etc/my_init.d
|
||||
ADD docker/db_migrate.sh /etc/my_init.d/db_migrate.sh
|
||||
RUN chmod +x /etc/my_init.d/db_migrate.sh
|
||||
|
||||
# Set Default RAILS_ENV
|
||||
ENV PASSENGER_APP_ENV docker
|
||||
|
||||
|
@ -14,6 +14,16 @@ class Recipe < ActiveRecord::Base
|
||||
validates :total_time, numericality: true, allow_blank: true
|
||||
validates :active_time, numericality: true, allow_blank: true
|
||||
|
||||
NAME_CUTOFF = 35
|
||||
|
||||
def display_name
|
||||
if self.name.length >= NAME_CUTOFF
|
||||
self.name[0...NAME_CUTOFF] + '...'
|
||||
else
|
||||
self.name
|
||||
end
|
||||
end
|
||||
|
||||
def scale(factor)
|
||||
recipe_ingredients.each do |ri|
|
||||
ri.scale(factor)
|
||||
|
@ -25,7 +25,7 @@
|
||||
<tbody>
|
||||
<% @recipes.each do |recipe| %>
|
||||
<tr>
|
||||
<td><%= link_to recipe.name, recipe %></td>
|
||||
<td><%= link_to recipe.display_name, recipe %></td>
|
||||
<td>
|
||||
<%= link_to edit_recipe_path(recipe), class: 'btn btn-sm btn-primary' do %>
|
||||
<span class="glyphicon glyphicon-pencil"></span>
|
||||
|
4
docker/db_migrate.sh
Normal file
4
docker/db_migrate.sh
Normal file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd /home/app/parsley/
|
||||
RAILS_ENV=$PASSENGER_APP_ENV bundle exec rake db:migrate
|
Loading…
Reference in New Issue
Block a user