Custom conf docker compose

I’m using softwaremill/elasticmq-native docker image in a docker compose file, working great but I would like to use it with a custom conf. Can custom.conf variables be passed using enviroment tag in docker compose file?

e.g:

sqs-local:
    container_name: sqs-local-dev
    image: softwaremill/elasticmq-native
    environment:
      - account_id: 123123
    ports:
      - '9324:9324'
      - '9325:9325'
    volumes:
      - 'sqs:/tmp/sqs_local'

If not, appreciate if you could share a recommended approach on how to pass custom.conf using docker compose. Thanks!

Hi @gihdz, how about passing the config as a volume mount?

    volumes:
      - ./custom.conf:/opt/elasticmq.conf

A working example you can run with the source code checked out:

services:
  sqs-local:
    container_name: sqs-local-dev
    image: softwaremill/elasticmq-native
    environment:
      account_id: 123123
    ports:
      - '9324:9324'
      - '9325:9325'
    volumes:
      - './integration-tests/conf/messages-storage.conf:/opt/elasticmq.conf'
      - '.data:/elasticmq/data'
1 Like

Worked like a charm, thanks so much @micossow !!