version: '3.8'
networks: 
  backend:
    name: jfe.backend
volumes:
  app-data:
  localstack-data:
services:
  apache:
    container_name: jfe.apache
    build: ../../docker/apache
    environment:
      TZ: "Asia/Tokyo"
    ports:
      - 8081:80
    volumes:
      - ../../jfe-system:/var/www/html
    networks:
      - backend
  mysql:
    container_name: jfe.mysql
    image: mysql:5.7
    environment: 
      MYSQL_ROOT_PASSWORD: mysql
      MYSQL_USER: default
      MYSQL_PASSWORD: secret
      MYSQL_DATABASE: jfe_system
      TZ: "Asia/Tokyo"
    volumes:
      - ./mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
    ports:
      - 3307:3306
    networks:
      - backend
  minio:
    container_name: jfe.minio
    image: minio/minio
    ports:
      - 9000:9000
      - 9001:9001
    volumes: 
      - ./minio/data:/export
    environment:
      MINIO_ACCESS_KEY: hogehoge
      MINIO_SECRET_KEY: hogehogehoge
    tty: true
    command: server /data --console-address ":9001"
    networks:
      - backend
  redis:
    container_name: jfe.redis
    image: redis:alpine
    ports:
      - 6379:6379
    networks:
      - backend
  mail:
    container_name: jfe.mail
    image: mailhog/mailhog
    ports:
      - 8025:8025
      - 1025:1025
    networks:
      - backend
  localstack:
    image: localstack/localstack:latest
    ports:
      - "4566:4566"
      - "4571:4571"
    environment:
      - SERVICES=s3
      - DEBUG=1
      - AWS_ACCESS_KEY_ID=test
      - AWS_SECRET_ACCESS_KEY=test
      - DEFAULT_REGION=ap-northeast-1
    volumes:
      - ${PWD}/../../docker/localstack:/docker-entrypoint-initaws.d
      - localstack-data:/var/lib/localstack
    networks:
      - backend
