-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add image parameters to
compose.yaml
(#1092)
Compose files can be parameterized using Bash-style (*sigh*) syntax ([1]). We add variables `JANUS_AGGREGATOR_IMAGE`, `JANUS_MIGRATOR_IMAGE`, `DIVVIUP_API_IMAGE` and `DIVVIUP_API_MIGRATOR_IMAGE` to allow setting Docker image tags like so: ```sh DIVVIUP_API_IMAGE=myrepository.dev/divviup_api:0.0.1 \ JANUS_AGGREGATOR_IMAGE=myrepository.dev/janus_aggregator:0.7.8 \ docker compose up ``` These variables are interpolated into the `image` field of the `service` elements ([2]). We also add `compose.dev.yaml`, which includes the base `compose.yaml` and adds overrides which remove the `image` element from the `divviup-api` services and add a `build` instead. This causes `docker compose` to build those images from local sources, on demand. We provide defaults for all these images that pull from Divvi Up owned public artifact repositories. It's somewhat unfortunate that we use a `divviup-api` version that is behind `main`, but on the other hand the objective is to enable a demo experience, so it makes sense to pin Janus and divviup-api versions where the demo is known to work end-to-end. [1]: https://docs.docker.com/compose/compose-file/12-interpolation/ [2]: https://docs.docker.com/compose/compose-file/05-services/#image [3]: https://docs.docker.com/compose/compose-file/build/#using-build-and-image
- Loading branch information
1 parent
6bf75f0
commit b189dbd
Showing
4 changed files
with
70 additions
and
28 deletions.
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
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,31 @@ | ||
# Overrides for the local development docker compose setup. Meant only to be used by | ||
# compose.dev.yaml | ||
|
||
services: | ||
divviup_api: | ||
image: !reset null | ||
build: | ||
context: . | ||
args: | ||
RUST_PROFILE: dev | ||
RUST_FEATURES: integration-testing | ||
develop: | ||
watch: | ||
- path: src/ | ||
action: rebuild | ||
|
||
divviup_api_migrate: | ||
image: !reset null | ||
build: | ||
context: . | ||
args: | ||
RUST_PROFILE: dev | ||
# This isn't strictly required for migrations, but it allows reusing one container image | ||
# for both this and the divviup_api service. | ||
RUST_FEATURES: integration-testing | ||
develop: | ||
watch: | ||
- path: migration | ||
action: rebuild | ||
ignore: | ||
- README.md |
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,8 @@ | ||
# Local development-only compose file which builds divviup-api from source. This is not suitable for | ||
# production! | ||
|
||
include: | ||
- path: | ||
# These files are ordered deliberately so that they will be merged correctly | ||
- compose.yaml | ||
- compose.dev.override.yaml |
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