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

Add Rails Docker Compose example #1

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

CodySanders
Copy link
Collaborator

No description provided.

@CodySanders CodySanders requested a review from townofdon May 14, 2021 04:07
@CodySanders CodySanders force-pushed the docker-compose-rails-example branch 2 times, most recently from bcae1c7 to 4290e61 Compare May 14, 2021 04:27
@CodySanders CodySanders force-pushed the docker-compose-rails-example branch from 4290e61 to 886490d Compare May 14, 2021 04:36
@@ -0,0 +1 @@
POSTGRES_PASSWORD="really-good-password"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the best

@townofdon
Copy link

@CodySanders This is awesome! 👏

Kind of a nit thing - for naming consistency could you change docker-compose-rails to example-rails?

Copy link

@townofdon townofdon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! I had a few suggestions/comments for learning purposes to make this easier to digest for someone completely new to Docker. Thanks for adding this!

@@ -8,7 +8,6 @@
- Add node.js Express / PostgreSQL example
- Add React (CRA) example
- Add React (Next.js) example
- Add Rails example

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a link to the rails example to line 4 of the readme? Also could we move the rails example to ./example-rails/?

FROM ruby:3.0.1

RUN apt update -qq && apt install -y nodejs npm postgresql-client
RUN npm install --global yarn

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is meant to be a tutorial of sorts, would you be up for adding some comments for what the various lines do? I went this direction in the php example - what do you think? I know it's verbose but for someone totally new to Docker, it would be helpful to have a line-by-line explanation.

@@ -0,0 +1,18 @@
services:
db:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be up for adding line-by-line comments/instructions to the docker compose file? I went with this approach here and it seemed to be good for learning purposes. Let me know what you think!

@CodySanders CodySanders requested a review from townofdon May 14, 2021 19:31
@CodySanders
Copy link
Collaborator Author

@townofdon I think I addressed all of the suggestions but let me know if I missed anything. I think the comments are certainly helpful but it would also be my hope that this project would be a jumping off point for a discussion with someone who is looking to get into Docker and using it in their development process. There are still many small nuances that aren't covered in detail here but I think it could be a good start.

@CodySanders
Copy link
Collaborator Author

Also, if you pull this down and try to run it please let me know if you run into any issues. I think I remembered to include everything needed but there is always the chance that my machine already had a forgotten dependency included that a new machine would not

@townofdon
Copy link

@CodySanders Awesome, thanks for adding those comments! I agree that the documentation is needed for understanding the nuances and anyone looking to deep-dive into Docker, but the comments definitely help and especially add context.

I checked out the branch and ran docker-compose up - worked like a charm!

However running the db:create and db:migrate scripts resulted in an err:

image

I saw that POSTGRES_PASSWORD is in .env-vars, maybe another env var is needed?

@CodySanders
Copy link
Collaborator Author

Hmm, I will take a look at that. If the .env-vars file is being included in those commands correctly (which I believe it should be since it is declared for those services in docker-compose.yml) then it should just work out of the box. I'll let you know what I find out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants