#!/usr/bin/env bash
set -euo pipefail

mkdir -p bin

# Adjust flags as you like
CXXFLAGS="-std=c++17 -O2 -Wall -Wextra -pedantic"

g++ ${CXXFLAGS} server.cpp -o bin/server
g++ ${CXXFLAGS} client.cpp -o bin/client

echo "Built:"
file bin/server bin/client || true

chmod a+x bin/server bin/client

docker compose up -d server
docker compose run --rm -it client

echo "Done."