Browse Source

Some changes.

master
Jonathan Rosenbaum 7 years ago
parent
commit
bb6109a9b5
  1. 30
      Dockerfile
  2. 7
      docker-compose.yml
  3. 11
      seeds.rb

30
Dockerfile

@ -1,22 +1,26 @@
#################
# Bike Database #
#################
# Password is password for staff@freeridepgh.org & volunteer@freeridepgh.org
# Password is password for
FROM bikebike/bikebike:16.04
FROM ruby:2.3.1
MAINTAINER Jonathan Rosenbaum <gnuser@gmail.com>
RUN git clone https://github.com/Loos/bike-database.git
RUN gem install bundler
RUN apt-get update && apt-get -y install g++ libfcgi-dev libsqlite3-dev libpq-dev nodejs
COPY Gemfile /bike-database/
RUN bundle install --gemfile=/bike-database/Gemfile
COPY database.yml /bike-database/config/
RUN cd /bike-database; bundle exec rake db:create db:migrate
WORKDIR /app
RUN git clone https://github.com/Loos/bike-database.git .
#RUN apt-get update && apt-get -y install g++ libfcgi-dev libsqlite3-dev libpq-dev nodejs
RUN apt-get update && apt-get -y install libsqlite3-0 nodejs
COPY Gemfile /app
COPY seeds.rb /app/db
RUN env NOKOGIRI_USE_SYSTEM_LIBRARIES=true bundle install --gemfile=/app/Gemfile
COPY database.yml /app/config/
RUN bundle exec rake db:create db:migrate db:setup
#CMD rails server -b 0.0.0.0 -p 3000
CMD rails s
# setup to use sqlite3
COPY bike-database.conf /etc/supervisor/conf.d/
CMD ["supervisord", "-c", "/etc/supervisor/supervisord.conf"]
# docker run -d -p 3000:3000 --name="bike-database" bikebike/bike-database

7
docker-compose.yml

@ -1,9 +1,10 @@
version: '2'
# git clone https://github.com/Loos/bike-database.git
# docker-compose run -w /app vtracklery2 env
# You can visit http://vtracklery.wvcompletestreets.org/api/workers/ and observe json data: user: admin password: password
#
# The environment is setup to use jwilder/nginx-proxy and
# JrCs/docker-letsencrypt-nginx-proxy-companion but can easily be
# modified to be served by an alternative http server.
services:
bike-database:

11
seeds.rb

@ -2,12 +2,7 @@ require "bcrypt"
salt = BCrypt::Engine.generate_salt
encrypted_password = BCrypt::Engine.hash_secret('password', salt)
User.create!(:email => "bike@bikelover.org", :encrypted_password => encrypted_pa
ssword).save(validate: false);
User.new(:email => "bike@bikelover.org", :encrypted_password => encrypted_password).save(validate: false);
Bike.create!(log_number: 1, brand: "Schwinn", model: "Paramount", bike_type: "Ro
ad", color: "Radiant Coppertone", purpose: "Sale", price: 300, serial_number: "2
2bikebike22")
Bike.create!(log_number: 2, brand: "Schwinn", model: "Paramount", bike_type: "
Road", color: "Flamboyant Lime", purpose: "Freecyclery", serial_number: "33bikeb
ike33")
Bike.create!(log_number: 1, brand: "Schwinn", model: "Paramount", bike_type: "Road", color: "Radiant Coppertone", purpose: "Sale", price: 300, serial_number: "22bikebike22")
Bike.create!(log_number: 2, brand: "Schwinn", model: "Paramount", bike_type: "Road", color: "Flamboyant Lime", purpose: "Freecyclery", serial_number: "33bikebike33")

Loading…
Cancel
Save