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

feat: docker run option #91

Merged
merged 3 commits into from
Sep 19, 2024

Conversation

ftupas
Copy link
Contributor

@ftupas ftupas commented Sep 19, 2024

This pr does the following:

❯ docker run -it --rm --name rainfrog \
  -p 5432:5432 \
  -e username="rainfrog" \
  -e password="password" \
  -e hostname="host.docker.internal" \
  -e db_port="5432" \
  -e dbname="rainfrog" rainfrog

image

Signed-off-by: Fred Tupas <fred.tupas21@gmail.com>
@ftupas
Copy link
Contributor Author

ftupas commented Sep 19, 2024

For now we build it locally but I think docker hub needs to be setup in order to

  • Publish the image to docker hub so it can be pulled directly
  • Add cicd for docker

@ftupas ftupas force-pushed the docker-run-option branch 3 times, most recently from 49142b4 to d7a7445 Compare September 19, 2024 09:43
Signed-off-by: Fred Tupas <fred.tupas21@gmail.com>
Copy link
Owner

Choose a reason for hiding this comment

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

curious, what's the reason for different images for runtime vs building?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

primarily for separation of concerns but also for efficiency and maintainability, bonus is you have a smaller image size

here's a great reference https://docs.docker.com/build/building/multi-stage/

COPY --chmod=755 --from=builder /app/target/release/rainfrog /usr/local/bin/rainfrog

# Change ownership of the files to the non-root user
RUN chown -R rainfrog:rainfrog /usr/src/app
Copy link
Owner

Choose a reason for hiding this comment

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

if the binary is in /usr/local/bin, does this chown do anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, updated it

Signed-off-by: Fred Tupas <fred.tupas21@gmail.com>
@achristmascarl
Copy link
Owner

For now we build it locally but I think docker hub needs to be setup in order to

  • Publish the image to docker hub so it can be pulled directly

  • Add cicd for docker

thanks for tackling this; it looks good, once the tests run i'll merge it and then set up dockerhub / change the readme in a follow up pr.

@achristmascarl achristmascarl merged commit f41002b into achristmascarl:main Sep 19, 2024
7 checks passed
Copy link

Included in release v0.2.3

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.

docker run option
2 participants