Skip to content

document compose definitions for mainstream technologies #48324

@vsevel

Description

@vsevel

Description

it takes some effort to come up with compose service definitions.
it would be nice to have those definitions in documentation, at least for mainstream technologies (e.g. relational db, mongo, kafka)
an alternative would to generate those resources at build time.
but in absence, it might be a good idea to provide these in documentation

Implementation ideas

apicurio:

  apicurio:
    image: apicurio/apicurio-registry-mem:2.4.2.Final
    ports:
      - "8080"

kafka:

  kafka:
    image: apache/kafka-native:3.9.0
    restart: "no"
    ports:
      - '9092'
    labels:
      io.quarkus.devservices.compose.exposed_ports: /etc/kafka/docker/ports
    environment:
      # KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9096
      # KAFKA_LOG_CLEANER_DEDUPE_BUFFER_SIZE: 2097152
      # KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
      KAFKA_NODE_ID: 1
      KAFKA_PROCESS_ROLES: broker,controller
      KAFKA_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093
      KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
      KAFKA_CONTROLLER_QUORUM_VOTERS: 1@localhost:9093
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
      KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
      KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
      KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
      KAFKA_NUM_PARTITIONS: 3
    command: "/kafka.sh"
    volumes:
      - './kafka.sh:/kafka.sh'

kafka.sh:

#!/bin/bash

# Wait for the ports file to be created
while [ ! -f /etc/kafka/docker/ports ]; do
  echo "Waiting for /etc/kafka/docker/ports to be created...";
  sleep 1;
done;

sleep 0.1;

# Source the file to load PORT_* variables
source /etc/kafka/docker/ports;

# Use the port mappings
export KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:$PORT_9092;
# Run the Kafka broker executable
/etc/kafka/docker/run

artemis:

  artemis:
    image: quay.io/arkmq-org/activemq-artemis-broker:artemis.2.40.0
    ports:
      - "61616"
    environment:
      AMQ_USER: admin
      AMQ_PASSWORD: admin
      AMQ_EXTRA_ARGS: --no-autotune --mapped --no-fsync

postgresql:

  postgresql:
    image: docker.io/postgres:17
    ports:
      - "5432"
    environment:
      POSTGRES_USER: quarkus
      POSTGRES_PASSWORD: quarkus
      POSTGRES_DB: quarkus

oracle:

  oracle:
    image: docker.io/gvenzl/oracle-free:23-slim-faststart
    ports:
      - "1521"
    environment:
      ORACLE_PASSWORD: quarkus
      ORACLE_DATABASE: quarkus
      APP_USER: quarkus
      APP_USER_PASSWORD: quarkus

sqlserver:

  mssql:
    image: mcr.microsoft.com/mssql/server:2022-latest
    ports:
      - "1433"
    environment:
      ACCEPT_EULA: "Y"
      MSSQL_SA_PASSWORD: Quarkus123
    labels:
      io.quarkus.devservices.compose.jdbc.parameters: trustServerCertificate=true

mongodb:

  mongo:
    image: docker.io/mongo:7.0
    ports:
      - "27017"

cc @ozangunalp

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions