-
Notifications
You must be signed in to change notification settings - Fork 3
[WIP] Add Dockerfile docker-compose file and bootstrap script #245
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
Open
jimmykarily
wants to merge
3
commits into
master
Choose a base branch
from
setup_development_environment
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,3 +25,4 @@ config/database.local.yml | |
| .env | ||
| docker-compose.yml | ||
| .DS_Store | ||
| bundle_cache | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| FROM ruby:2.3 | ||
|
|
||
| RUN apt-get update && apt-get install -y nodejs fontconfig | ||
|
|
||
| ENV PHANTOM_JS phantomjs-2.1.1-linux-x86_64 | ||
|
|
||
| RUN curl https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2 -O -L | ||
| RUN tar xvjf $PHANTOM_JS.tar.bz2 | ||
| RUN mv $PHANTOM_JS /usr/local/share | ||
| RUN ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin | ||
|
|
||
| WORKDIR /usr/src/app | ||
|
|
||
| CMD rails s -b 0.0.0.0 -p 3000 Puma |
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/bash | ||
|
|
||
| docker exec -it $(docker ps | grep testributor-development-katana | awk '{print $1}') $@ |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| version: "2" | ||
| services: | ||
| web: | ||
| image: testributor:development | ||
| command: "./script/bootstrap_development.sh" | ||
| container_name: testributor-development-katana | ||
| volumes: | ||
| - .:/usr/src/app | ||
| # Avoid downloading all gems from scratch by mounting the directory | ||
| # on the host. See also bootstrap_development.sh script. | ||
| - ./bundle_cache:/vendor/bundle | ||
| depends_on: | ||
| - postgres | ||
| - redis | ||
| links: | ||
| - postgres | ||
| - redis | ||
| - socketidio | ||
| environment: | ||
| RAILS_ENV: development | ||
| SECRET_KEY_BASE: e9744e038fb87c6bfb52d5aa0f2f1a865fbd242a6ce162cb6e5cae9e5e90c558c32f369d3d68ea0ae5325916fb55507a164011964edc4ac2bf1a31a0573efe73 | ||
| REDIS_URL: redis://redis:6379 | ||
| env_file: | ||
| - .env | ||
| ports: | ||
| - "3000:3000" | ||
| postgres: | ||
| image: postgres:9.4 | ||
| container_name: testributor-development-postgres | ||
| environment: | ||
| POSTGRES_USER: testributor | ||
| POSTGRES_PASSWORD: testributor | ||
| expose: | ||
| - "5432" | ||
| redis: | ||
| image: redis:3.0 | ||
| container_name: testributor-development-redis | ||
| expose: | ||
| - "6379" | ||
| socketidio: | ||
| image: jimmykarily/socketidio:0.0.2 | ||
| container_name: testributor-development-socketidio | ||
| expose: | ||
| - "9000" | ||
| links: | ||
| - redis | ||
| environment: | ||
| REDIS_URL: redis://redis:6379 |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/bin/bash | ||
|
|
||
| gem install bundler | ||
| bundle check || bundle install --deployment --path /vendor/bundle --jobs 2 --retry 2 | ||
| rake db:create | ||
| rake db:reset | ||
| rails s -b 0.0.0.0 -p 3000 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean development data loss upon each container start?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is true. Maybe we should skip the database setup and let the developer/user do this manually. What do you think?