version: "3.7"
services:
  app:
    container_name: rsdeveloper-laravel
    build:
      context: .
      dockerfile: Dockerfile
    #    image: 'laravel_php7.4.1'
    ports:
      - "8000:80"
    restart: unless-stopped
    volumes:
      - ./:/var/www/html

  mysql:
    container_name: rsdeveloper-mysql
    image: mysql:5.7.22
    restart: unless-stopped
    ports:
      - "3306:3306"
    environment:
      MYSQL_ROOT_HOST: '%'
      MYSQL_DATABASE: ${DB_DATABASE}
      MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
      MYSQL_USER: ${DB_USERNAME}
      MYSQL_PASSWORD: ${DB_PASSWORD}
      TZ: "America/Maceio"
    volumes:
      - ./_mysql_backup/data:/var/lib/mysql

networks:
  rede-laravel:
    driver: bridge

#===================================#
#  sudo service docker start
#  docker compose help
#  docker compose up -d
#  docker-compose up -d --build
#  Para todas as instâncias
#  docker stop $(docker ps -a -q)
#  Remove todas as instâncias
#  docker rm $(docker ps -a -q)
#  docker ps
#  docker ps -a
#  docker stats
#  docker-compose ps
#  docker image rm $(docker image ls -a -q)
#===================================#
 ## coipa de um dir para outro
 ## cp -r ~/app_producao/erp_gestao_municipal_lv6_ERRO/erp/_mysql_backup ~/app_producao/erp_gestao_municipal_lv6/erp
 ## remove dir
 ## rm -rf _mysql_backup_

# https://webomnizz.com/containerize-your-laravel-application-with-docker-compose/
# docker compose exec app bash
# http://127.0.0.1:8000/
# http://localhost:8000/
# https://hub.docker.com/_/php/tags?page=1&name=apache

# application/x-zip-compresseds
# --------------------------------- #
# RODAR OS COMANDO NO DOCKER NATIVO #
# --------------------------------- #
# sudo service docker start

# docker compose --version
# docker compose up -d
# docker compose exec app bash
# https://www.hostinger.com.br/tutoriais/install-docker-ubuntu
# https://github.com/codeedu/wsl2-docker-quickstart
# https://stackoverflow.com/questions/50552970/laravel-docker-the-stream-or-file-var-www-html-storage-logs-laravel-log-co
# https://medium.com/codigorefinado/docker-no-linux-dentro-do-windows-10-com-wsl-2-f52b91931267
# sudo chown -R www-data:www-data storage/ (dar pesmissão na  pasta)

# https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-20-04
# https://stackoverflow.com/questions/54831494/sh-1-cross-env-permission-denied-on-laravel-mix
