services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    image: ta-stunting-be
    container_name: ta_stunting_be_app
    restart: unless-stopped
    tty: true
    environment:
      SERVICE_NAME: app
      SERVICE_TAGS: dev
    working_dir: /var/www
    volumes:
      - ./:/var/www
    networks:
      - stunting_net

  web:
    image: nginx:alpine
    container_name: ta_stunting_be_web
    restart: unless-stopped
    tty: true
    ports:
      - "8001:80"
    volumes:
      - ./:/var/www
      - ./docker/nginx/conf.d/:/etc/nginx/conf.d/
    networks:
      - stunting_net

  db:
    image: mysql:8.0
    platform: linux/amd64
    container_name: ta_stunting_be_db
    restart: unless-stopped
    environment:
      MYSQL_DATABASE: ${DB_DATABASE:-ta_stunting}
      MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:-root}
    ports:
      - "33060:3306"
    volumes:
      - dbdata:/var/lib/mysql
    networks:
      - stunting_net

networks:
  stunting_net:
    driver: bridge
    name: stunting_network

volumes:
  dbdata:
    driver: local
