-
Notifications
You must be signed in to change notification settings - Fork 2
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
Adding Docker-Compose #53
Conversation
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.
Looks good overall. Just some minor nitpicking about formatting and using env variables.
README.md
Outdated
``` | ||
sudo bash docker_shell.sh | ||
``` | ||
If you want to access the rails console, then run the following comand after the previous one: |
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 definitely not a priority but could you fix the spelling on command
?
docker-compose.yml
Outdated
volumes: | ||
- ./:/usr/src/app | ||
ports: | ||
- "3000:3000" |
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.
Silly EOL error that might return to haunt us later.
Consider using a Ruby formatter in a .gitattribute
file that will automatically handle this, along with other formatting issues, when the changes are pushed to our remote.
For Python, I use a PEP-8 formatter called Black; I found this for Ruby, maybe this'll be helpful in our case.
docker/Dockerfile
Outdated
EXPOSE 3000 | ||
|
||
# Default command that runs when the container starts | ||
CMD ["bash", "docker/docker_set_up.sh"] |
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.
EOL error again.
docker/docker_set_up.sh
Outdated
@@ -0,0 +1,3 @@ | |||
rm tmp/pids/server.pid | |||
yarn install --check-files | |||
bundle exec rails server -b 0.0.0.0 |
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.
@abhinavtripathy are we starting the server at 0.0.0.0
or does this reference the port
specified in docker-compose.yml
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.
it references the port specified in docker-compose
docker_shell.sh
Outdated
@@ -0,0 +1 @@ | |||
docker-compose exec rails ${@:-/bin/bash} |
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.
EOL 💀
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.
Looks good to go!
Looks great!! |
Added docker-compose with rails and postgres containers. Added shell scripts to access both containers. Added Dockerfile with yarn support and added db_setup script. Added documentation to readme for building and running containers with common errors. This closes #17