-
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.exampleto.envin 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
copy .env.example to .env in your working directory and fill it in with your values
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_devOr clone the code and use Docker Compose:
git clone https://github.ibm.com/ATAT/CyberShop.git && cd CyberShop && mv ../.env .
docker-compose upVisit http://localhost:3000 from a browser
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 serverVisit http://localhost:3000 from a browser
Modify any files in /app and refresh browser to view updates
(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-nginxto/etc/nginx/sites-available/CyberShopon 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