This repository has been archived by the owner on Jul 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 238
Example with Docker Compose #8
Open
vovimayhem
wants to merge
1
commit into
rails:master
Choose a base branch
from
vovimayhem:f5e/docker-compose
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
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 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 |
---|---|---|
|
@@ -16,3 +16,6 @@ | |
/tmp/* | ||
!/log/.keep | ||
!/tmp/.keep | ||
|
||
/vendor/bundle | ||
/.bash_history |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
# The Redis Container: | ||
redis: | ||
image: redis:3.0 | ||
ports: | ||
- "6379:6379" # Bind host port 6379 to Redis container's port 6379 | ||
|
||
# The Web container: | ||
web: &app_base | ||
image: vovimayhem/app-dev:mri-2.2 | ||
command: rails server -p 3000 -b 0.0.0.0 | ||
ports: | ||
- "3000:3000" # Bind host port 3000 to app container's HTTP port 3000 | ||
volumes: | ||
- .:/app | ||
############################################################################## | ||
# With linked containers, Docker writes entries to the container's /etc/hosts. | ||
# We'll try here naming the entries docker will insert into the | ||
# container's /etc/hosts, so we can use more familiar URL's for our app - See | ||
# this container's environment section below: | ||
links: &app_links | ||
- redis:redis.example.com | ||
environment: &app_environment | ||
|
||
# The Redis URL: | ||
REDIS_URL: redis://redis.example.com:6379 | ||
|
||
RAILS_LOG_TO_STDOUT: true | ||
|
||
# Run the app in the 'development' environment: | ||
RACK_ENV: development | ||
RAILS_ENV: development | ||
|
||
cable: | ||
<<: *app_base | ||
command: cable | ||
ports: | ||
- "28080:28080" # Bind host port 28080 to app container's WebSocket port 28080 |
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.
Why not an image from https://registry.hub.docker.com/_/rails/ ?
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.
@syndbg The example rails app uses an unreleased version of Rails 5.0 (as it's currently being developed), so you'll not find it on the official Docker library.
I also admit that although there's an official Ruby image, I find this one easier to use, as it does not require any building step besides the
bundle install
. (I remember having to run some sort of building step in the official ruby image)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.
@vovimayhem Aha, I see! Good to know. :)