Skip to content

dtom90/CyberShop

 
 

Repository files navigation

CyberShop

Build Status

Installation

Manual

  • Install Ruby version 2.3.4

  • Install Bundler: gem install bundler

  • Install package dependencies: bundle install

  • Database creation: rake db:migrate

  • Configure Environment: copy .env.example to .env in your working directory and fill it in with your values

  • Database initialization: rake db:seed

  • Test suite: bundle exec rake

  • Run the app: rails server

Docker

Configure Environment

copy .env.example to .env in your working directory and fill it in with your values

Quick Deploy in Development Mode

Build and run with standard Docker:

docker build -t cybershop_dev https://github.ibm.com/ATAT/CyberShop.git
docker run -it -p 3000:3000 --env-file .env cybershop_dev

Or clone the code and use Docker Compose:

git clone https://github.ibm.com/ATAT/CyberShop.git && cd CyberShop && mv ../.env .
docker-compose up

Visit http://localhost:3000 from a browser

Local Development with Live Reload

Clone the code, then Docker build and run:

git clone https://github.ibm.com/ATAT/CyberShop.git && cd CyberShop && mv ../.env .
docker build -t cybershop_dev .
docker run -it -p 3000:3000 --env-file .env -v `pwd`:`pwd` -w `pwd` cybershop_dev rails db:migrate && rails server

Visit http://localhost:3000 from a browser
Modify any files in /app and refresh browser to view updates

Production

(These instructions are for Ubuntu, other OSes may be different)

  • Get a domain name and point it to your server
  • Open ports 80 and 443
  • Install NGINX on your server
  • Copy build/production/CyberShop-nginx to /etc/nginx/sites-available/CyberShop on your server
  • Modify the file on your server (/etc/nginx/sites-available/CyberShop) with the domain name pointing to your server:
    server_name <DOMAIN_NAME>;
    
  • Enable the new site configuration
    cd /etc/nginx/sites-enabled
    rm default
    ln -s /etc/nginx/sites-available/CyberShop CyberShop
  • Run certbot on your server to get an SSL certificate
  • Build and run the docker container
    docker build -t cybershop_prod --build-arg RAILS_ENV=production https://github.ibm.com/ATAT/CyberShop.git
    docker run -d -p 3000:3000 --env-file .env -v CyberShop:/CyberShop/public cybershop_prod
    ln -s /var/lib/docker/volumes/CyberShop/_data public
  • Visit your domain name from a browser

About

Demo Consumer Electronics Retail Store Web Application using IBM Machine Learning to read a customer's mind

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 69.9%
  • HTML 12.0%
  • JavaScript 9.7%
  • CSS 6.6%
  • CoffeeScript 0.9%
  • Dockerfile 0.7%
  • Shell 0.2%