mirror of
https://github.com/fspc/bike-database-docker.git
synced 2025-02-28 17:43:23 -05:00
Modernizes the docker instance, and add seeds.rb.
This commit is contained in:
parent
9f89488f49
commit
d540f29354
@ -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
Normal file
33
docker-compose.yml
Normal file
@ -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
Normal file
13
seeds.rb
Normal file
@ -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…
x
Reference in New Issue
Block a user