Browse Source

Modernizes the docker instance, and add seeds.rb.

master
Jonathan Rosenbaum 7 years ago
parent
commit
d540f29354
  1. 4
      bike-database.conf
  2. 33
      docker-compose.yml
  3. 13
      seeds.rb

4
bike-database.conf

@ -1,4 +0,0 @@
[program:bike-database]
directory=/bike-database
command=rails server -b 0.0.0.0 -p 3000
autorestart=true

33
docker-compose.yml

@ -0,0 +1,33 @@
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
services:
bike-database:
container_name: bike-database
build: .
network_mode: "bridge"
restart: always
volumes:
- data:/app/db
expose:
- "3000"
command: bundle exec rails s -b 0.0.0.0 -p 3000
environment:
- PORT=3000
- VIRTUAL_HOST=bike-database.bikelover.org
- VIRTUAL_PORT=3000
- LETSENCRYPT_HOST=bike-database.bikelover.org
- LETSENCRYPT_EMAIL="bike@bikelover.org"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
volumes:
data:

13
seeds.rb

@ -0,0 +1,13 @@
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);
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")
Loading…
Cancel
Save