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

Only use Vite in compose.dev.yaml #1124

Merged
merged 1 commit into from
Jun 17, 2024
Merged

Only use Vite in compose.dev.yaml #1124

merged 1 commit into from
Jun 17, 2024

Conversation

tgeoghegan
Copy link
Contributor

We want demo users to be able to get started with nothing but a divviup binary, a working Docker Compose install and compose.yaml. divviup_api_vite relies on having a local checkout of the static assets to serve. We now use the diviup_api_integration_test image to serve static assets from service static_assets. The assets in question are already present in the image being run in service divviup_api, but I did it this way for the following reasons:

  • divviup-api routes requests to the static asset handler based on hostname, making it difficult to serve alongside the API. I tried creating some aliases (1) in Docker Compose, but those names are only visible inside the compose network, meaning you have to set the Host header from outside the netns, which is a hassle I don't want to inflict on demo users.
  • Having a distinct service for assets is convenient because we can make it depend on pair_aggregators. If that ran last, it could cause docker compose up --wait to fail (see comment in compose.yaml).

Part of #1096

@tgeoghegan tgeoghegan requested a review from a team as a code owner June 17, 2024 21:42
@tgeoghegan tgeoghegan mentioned this pull request Jun 17, 2024
9 tasks
# Disable cone mode so we only grab a specific file
# https://github.com/actions/checkout?tab=readme-ov-file#fetch-only-a-single-file
# https://git-scm.com/docs/git-sparse-checkout
sparse-checkout-cone-mode: true
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't match the linked example

Suggested change
sparse-checkout-cone-mode: true
sparse-checkout-cone-mode: false

We want demo users to be able to get started with nothing but a
`divviup` binary, a working Docker Compose install and `compose.yaml`.
`divviup_api_vite` relies on having a local checkout of the static
assets to serve. We now use the `diviup_api_integration_test` image to
serve static assets from service `static_assets`. The assets in question
are already present in the image being run in service `divviup_api`, but
I did it this way for the following reasons:

- `divviup-api` routes requests to the static asset handler based on
  hostname, making it difficult to serve alongside the API. I tried
  creating some aliases ([1]) in Docker Compose, but those names are
  only visible inside the compose network, meaning you have to set the
  `Host` header from outside the netns, which is a hassle I don't want
  to inflict on demo users.
- Having a distinct service for assets is convenient because we can make
  it depend on `pair_aggregators`. If that ran last, it could cause
  `docker compose up --wait` to fail (see comment in `compose.yaml`).

[1]: https://docs.docker.com/compose/compose-file/05-services/#aliases

Part of #1096
@tgeoghegan tgeoghegan merged commit 3064de8 into main Jun 17, 2024
8 checks passed
@tgeoghegan tgeoghegan deleted the timg/compose-vite branch June 17, 2024 22:18
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