docker run -d --name postgres -v postgres:/var/lib/postgresql/data postgres:9-alpine
docker run --rm -i --link postgres postgres:9-alpine psql -h postgres -U postgres <<EOF
create table employees (emp_no integer, first_name varchar, last_name varchar);
insert into employees values (0, 'John', 'Smith'), (1, 'Jane', 'Doe');
EOF
docker build -t insights .
docker run -it --rm -w /insights -v $PWD/run.sh:/run.sh -v $PWD/insights.yml:/insights.yml -v insights:/insights/db -p 3300:3300 -p 3350:3350 --link postgres insights bash /run.sh
open http://localhost:3300/
Last active
May 24, 2017 13:04
-
-
Save mrw34/d60fa30a08c864286e819647fc0eaac2 to your computer and use it in GitHub Desktop.
Quickstart for https://github.com/mariusandra/insights
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* | |
!install.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM centos:7 | |
COPY install.sh / | |
RUN bash install.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
Employee: | |
enabled: true | |
table_name: employees | |
columns: | |
emp_no: | |
type: :number | |
first_name: | |
type: :string | |
last_name: | |
type: :string | |
custom: {} | |
links: | |
incoming: {} | |
outgoing: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e -o pipefail | |
curl https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz | tar xJ -C /usr/local/bin --strip-components=2 wkhtmltox/bin/wkhtmltopdf | |
yum install -y postgresql-devel sqlite-devel git which libXrender libXext xorg-x11-fonts-Type1 | |
yum install -y centos-release-scl | |
yum install -y rh-ruby23 rh-ruby23-ruby-devel rh-nodejs4 | |
git clone https://github.com/mariusandra/insights | |
cd insights/ | |
. /opt/rh/rh-ruby23/enable | |
gem install bundler | |
bundle | |
. /opt/rh/rh-nodejs4/enable | |
npm install -g yarn | |
yarn | |
cp config/database.yml.example config/database.yml | |
bundle exec rake db:create | |
bundle exec rake db:schema:load | |
cat <<EOF >config/initializers/insights.rb | |
INSIGHTS_EXPORT_PATH = '/insights.yml' | |
INSIGHTS_TIMEZONE = 'Europe/London' | |
INSIGHTS_DATABASE = { | |
adapter: 'postgresql', | |
host: 'postgres', | |
database: 'postgres', | |
username: 'postgres' | |
} | |
INSIGHTS_LOGIN = false | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e -o pipefail | |
. /opt/rh/rh-ruby23/enable | |
. /opt/rh/rh-nodejs4/enable | |
bundle exec foreman start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment