Skip to content

sohamchavan07/tic-tac-toe

Repository files navigation

Tic Tac Toe

A simple, animated Tic Tac Toe game served as static files.

Prerequisites

  • Optional (for local static server):
    • Node.js 18+ or Python 3
  • Optional (for linting):
    • npm (comes with Node.js)
  • Optional (for containerized run):
    • Docker and Docker Compose v2

Run Locally (no build required)

The app is pure static content under public/. Use any static file server:

  • Option A: Python
cd public
 -m http.server 8080
# Open http://localhost:8080
  • Option B: Node (using npx serve)
npx --yes serve public -l 8080
# Open http://localhost:8080
  • Option C: Any editor extension (e.g., Live Server) targeting the public/ folder.

Run with Docker

An Nginx image serves the static site from /usr/share/nginx/html.

  • Build image:
docker build -t tic-tac-toe:latest -f dockerfile .
  • Run container:
docker run --rm -p 80:80 tic-tac-toe:latest
# Open http://localhost/

Using Docker Compose

A compose file is provided in tic-deploy/docker-compose.yml.

  • Use an existing image (recommended):
IMAGE_NAME=tic-tac-toe:latest docker compose -f tic-deploy/docker-compose.yml up -d
# Healthcheck expects http://localhost to respond
  • Or first build locally, then bring up compose:
docker build -t tic-tac-toe:latest -f dockerfile .
IMAGE_NAME=tic-tac-toe:latest docker compose -f tic-deploy/docker-compose.yml up -d

Development

  • Lint:
npm run lint

Note: There is no bundler/build step; edit public/index.html directly.

Testing

A Jest dev dependency is present, but the test script is currently a placeholder. You can wire up tests under tests/ and update package.json accordingly.

Project Structure

public/             # Static site (entry: index.html)
dockerfile          # Nginx-based static hosting image
tic-deploy/         # Docker Compose deployment helper

About

game

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors