A browser-based Arkanoid clone built with Phaser 3 and Vite. All graphics and audio are generated programmatically — no external asset files required.
- Docker installed and running.
docker build -t arkanoid .This runs a two-stage build:
- builder — installs Node dependencies and runs
vite buildinside the container. - runtime — copies only the compiled static files into a lean nginx image.
The final image is roughly 50 MB and contains no Node.js or source code.
docker run -d --name arkanoid -p 5173:80 arkanoidOpen http://localhost:5173 in your browser.
| Flag | Meaning |
|---|---|
-d |
Run in the background (detached) |
--name arkanoid |
Give the container a memorable name |
-p 5173:80 |
Map host port 5173 → container port 80 |
Change 5173 to any free port on your machine if needed.
docker stop arkanoid
docker rm arkanoiddocker rmi arkanoidRun on a different host port:
docker run -d --name arkanoid -p 3000:80 arkanoidRun in the foreground (see nginx logs directly):
docker run --rm --name arkanoid -p 5173:80 arkanoidCheck container logs:
docker logs arkanoidRebuild after source changes:
docker build -t arkanoid .
docker stop arkanoid && docker rm arkanoid
docker run -d --name arkanoid -p 5173:80 arkanoidnpm install
npm run devOpen http://localhost:5173.
arkanoid/
├── src/
│ ├── main.js # Phaser game config & bootstrap
│ ├── constants.js # Shared numeric constants
│ ├── levels/ # Level layout definitions
│ ├── scenes/
│ │ ├── BootScene.js # Generates all textures at startup
│ │ ├── MenuScene.js # Title / start screen
│ │ ├── GameScene.js # Main gameplay loop
│ │ └── UIScene.js # HUD overlay (score, lives, level)
│ └── objects/
│ ├── PowerUp.js # Power-up effects & timers
│ └── AudioManager.js # Procedural SFX + background music
├── index.html
├── vite.config.js
├── Dockerfile
├── nginx.conf # nginx config used inside the container
└── .dockerignore
| Input | Action |
|---|---|
| Mouse move | Move paddle |
| Click | Launch ball / fire laser (with laser power-up) |
+ / - |
Increase / decrease ball speed |