Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added docker and makefile #49

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
25 changes: 25 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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