version: '3'

services:
  mysql:
    image: mysql
    ports:
      - '23306:3306'
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
      MYSQL_USER: support_portal_user
      MYSQL_PASSWORD: support_portal_password
      MYSQL_DATABASE: support-portal
    volumes:
    - mysql-data:/var/lib/mysql

  adminer:
    image: adminer
    restart: always
    ports:
      - 8081:8080

#https://medium.com/dandelion-tutorials/using-s3-localstack-with-spring-boot-and-r2dbc-5ea201a18aea

  localstack:
    container_name: localstack
    image: localstack/localstack:latest
    environment:
      - DEBUG=1
      - USE_SSL=0
      - AWS_CBOR_DISABLE=1
#      - DOCKER_HOST=unix:///var/run/docker.sock
      - HOSTNAME=localstack
      - SERVICES=s3
      - AWS_DEFAULT_REGION=eu-north-1
    ports:
      - '4566-4583:4566-4583'
    volumes:
#      - ./tmp/lib/localstack:/tmp/lib/localstack
      - ./init-s3-bucket.sh:/etc/localstack/init/ready.d/init-s3-bucket.sh
#      - ${TEMPDIR:-/tmp/localstack}:/tmp/localstack - LEGACY (or use LEGACY_INIT_DIR=1)
#      - ./init-s3-bucket.sh:/docker-entrypoint-initaws.d/init-s3-bucket.sh - LEGACY (or use LEGACY_INIT_DIR=1)
#      - /var/run/docker.sock:/var/run/docker.sock

volumes:
  mysql-data:

