version: '3.3'
services:
  db:
    build: ./docker/mysql
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_DATABASE: sample_db
      MYSQL_USER: user
      MYSQL_PASSWORD: password
      MYSQL_ROOT_PASSWORD: rootpassword
    ports:
    - "3306:3306"
    volumes:
    - ./docker/mysql/initdb.d:/docker-entrypoint-initdb.d
    - ./docker/mysql/conf.d:/etc/mysql/conf.d
    - ./log/mysql:/var/log/mysql

  app:
    build: ./docker/spring-boot
    image: taiga/boot:0.1.0
    depends_on:
    - db
    ports:
    - "8080:8080"
    volumes:
    - .:/app
    environment:
      JAR_TARGET: cosmos_server-sb-0.0.1-SNAPSHOT.jar

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    environment:
    - PMA_ARBITRARY=1
    - PMA_HOST=db
    - PMA_USER=root
    - PMA_PASSWORD=rootpassword
    links:
    - db
    ports:
    - 1111:80
    volumes:
    - /sessions
