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 container support to repo #43

Merged
merged 13 commits into from
Oct 11, 2023
Merged

Conversation

devkelley
Copy link
Contributor

Motivation and Context

Adds support to build and run the service in both docker and podman containers.

Description

This PR does the following:

  • Adds a dockerfile to build the container image.
  • Adds env file templates to use for docker and podman.
  • Updates readme to show how to build and run the service in a container.
  • Adds a 'localhost' function that modifies a url to replace 0.0.0.0 with the container's appropriate DNS alias for outbound requests.
  • Uses the above 'localhost' function in the pub-sub-service project for all outbound communication (Mosquitto, Chariott, Publisher services)
  • Adds a 'containerize' feature to pub-sub-service, putting the DNS replacement code behind it. This feature will be used when building the container from the Dockerfile but is not a default feature.

The following will be addressed in a future PR:

  • Update where the yaml configuration files should be placed so that they do not need to be copied from /target/debug when building the container. This should be standardized, and I haven't though enough about where it should go.

Copy link

@ashbeitz ashbeitz left a comment

Choose a reason for hiding this comment

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

Approved

Dockerfile Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
pub-sub-service/Cargo.toml Show resolved Hide resolved
pub-sub-service/src/load_config.rs Outdated Show resolved Hide resolved
pub-sub-service/src/load_config.rs Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Copy link
Contributor

@ladatz ladatz left a comment

Choose a reason for hiding this comment

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

Just one question, looks good beside that

README.md Show resolved Hide resolved
@devkelley devkelley merged commit ec82582 into main Oct 11, 2023
9 checks passed
@devkelley devkelley deleted the devkelley/add_docker_container branch November 28, 2023 17:38
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.

5 participants