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: adding curl to distrolles image #811

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ericchaves
Copy link

Hi folks,

In this PR I've changed the gradle configuration in order to build a local image adding curl to the image, allowing declaring services that depends on the mock-aoauth2-server to be up and healthy, like the example at the end.

However in order to be merged, this PR may require some extra work that I don't know how to do:

the original build.gradle.kts builds multiarch container images. I'm not sure to achieve this given that the current workflow uses the github/workflows to publish into a GCR repository. The way I'm used to build multiarch images ,the docker build command needs to push images to a registry as part of the build and I never did something like this so I wouldn't be able to test it properly.

Anyway, hope this helps somehow. =)

sample compose.yaml

services:
  mock-oauth2-server:
    image: mock-oauth2-server:latest
    healthcheck:
      test: ["CMD", "curl", "--retry", "7", "--retry-delay", "1", "--retry-connrefused", "-f", "http://localhost:8080/isalive"]
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 5s
    ports:
      - "8080:8080"
    volumes:
      - ./src/test/resources/config.json:/app/config.json
      - ./src/test/resources/login.example.html:/app/login/login.example.html
      - ./src/test/resources/static/:/app/static/
    environment:
      LOG_LEVEL: "debug"
      SERVER_PORT: 8080
      JSON_CONFIG_PATH: /app/config.json

  test-healthcheck:
    image: curlimages/curl:latest
    depends_on:
      mock-oauth2-server:
        condition: service_healthy
    command: http://mock-oauth2-server:8080/issuer1/.well-known/openid-configuration

@ericchaves ericchaves requested a review from a team as a code owner February 18, 2025 14:04
@github-actions github-actions bot added the stale label Mar 6, 2025
@ybelMekk ybelMekk removed the stale label Mar 6, 2025
@github-actions github-actions bot added the stale label Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants