version: '3'

services:
  mysql:
    image: mysql:5.6
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: niemcy555
      MYSQL_DATABASE: sellbox_production
      MYSQL_USER: sellbox
      MYSQL_PASSWORD: niemcy555
    ports:
      - "9906:3306"
    networks:
      - database_network
    volumes:
      - ./docker/mysql:/var/lib/mysql
  phpmyadmin:
    image: phpmyadmin/phpmyadmin:latest
    restart: always
    ports:
      - 8081:80
    depends_on:
      - mysql
    environment:
      PMA_HOST: mysql
      PMA_PORT: 3306
      UPLOAD_LIMIT: 300M
    networks:
      - database_network
  memcached:
    image: docker.io/bitnami/memcached:1
    ports:
      - '11211:11211'
    networks:
      - app_network
  web:
    build:
      context: .
      dockerfile: ./docker/php/Dockerfile
    restart: always
    depends_on:
      - mysql
    volumes:
      - ./app/:/var/www/html/ 
    ports:
      - "80:80"
      - "443:443"
    stdin_open: true
    tty: true
    networks: 
      - database_network
      - app_network
networks:
  database_network:
    driver: bridge
  app_network:
    driver: bridge
    