diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..c9e79194 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM ruby:1.9.3 +RUN apt-get update && apt-get install imagemagick libmagickcore-dev \ + libmagickwand-dev libmagick++-dev libxml2-dev libxslt-dev \ + libpq-dev libssl-dev -y \ + && rm -rf /var/lib/apt/lists/* + +COPY Gemfile* ./ +RUN bundler install + +COPY . /code +WORKDIR /code +CMD ["bundle", "exec", "rails", "server"] diff --git a/Gemfile b/Gemfile index 7631197b..f221d568 100644 --- a/Gemfile +++ b/Gemfile @@ -48,7 +48,7 @@ gem 'rails_autolink', '~> 1.0.7' # Uploads gem 'carrierwave', '= 0.5.8' -gem 'rmagick' +gem 'rmagick', '= 2.16.0' gem 'fog' # Other Tools diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..ec0d07a8 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +build: + docker-compose build + +db.migrate: build + docker-compose run nosvc bundle exec rake db:migrate + +run: db.migrate + docker-compose up -d diff --git a/README.md b/README.md index 2198e3fc..0a0ecb4d 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,22 @@ Nós.vc is a crowdlearning plataform for inspiring encounters. -## Development environment +## Development environment using Docker + +You'll need [docker](https://www.docker.com/) and `make`. + +1. Clone the repository: + + `git clone git://github.com/engageis/nos.vc.git` + +2. Enter the repo directory: + + `cd nos.vc` + +3. Run the environment: + `make run` + +## Development environment without docker You'll need [RVM](https://rvm.io/) to isolate your development environment. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..b38e7e22 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,25 @@ +version: '2' +services: + nosvc: + build: + context: . + dockerfile: Dockerfile + environment: + - RAILS_ENV=development + depends_on: + - db + ports: + - "3000:3000" + + db: + image: postgres:9.6 + environment: + - POSTGRES_PASSWORD=catarse + - POSTGRES_USER=catarse + - POSTGRES_DB=catarse_development + volumes: + - "db:/var/lib/postgresql" + +volumes: + db: + external: false