version: '3.8'

services:
  server:
    build: ./server
    container_name: tictactoe-server
    restart: unless-stopped
    ports:
      - "1870:1870"
    networks:
      - tictactoe-net

  web:
    build: ./web-client
    container_name: tictactoe-web
    restart: unless-stopped
    environment:
      - GAME_SERVER_HOST=server
      - GAME_SERVER_PORT=1870
      - SERVER_PORT=8080
    depends_on:
      - server
    networks:
      - tictactoe-net

networks:
  tictactoe-net:
    driver: bridge
