This is a small Pong game based on JavaScript (server-side and client-side) with WebSockets. I created it quite some time ago to get in touch with docker and try out the websocket technology. It is possible to play this game against AI or against an opponent via network. This game also has a lobby where players can find and challenge each other.
0.0.1
- Used Tech
- Installation using vanilla docker
- Installation using Docker compose
- Installation on Kubernetes
- Installation on Kubernetes using helm
- Building images locally
- Backing up your highscore
- Customizing application behavior
websocket-pong uses a number of open source projects to work properly:
- jQuery - The most popular JavaScript library!
- WebSockets - awesome technology to allow real-time communication between server and client
- NodeJS - the lightning-fast server-side JavaScript framework
- express - A framework based on NodeJS which adds numerous features
- bootstrap - A HTML/CSS framework to support responsive web applications
- Docker - Cool container stuff
- Run the application
$ docker run -it -p 80:8081 -e PORT=8081 -d --name pong-web ellistheellice/websocket-pong
- Verify the installation
$ docker ps $ curl http://localhost
- Install docker-compose
- Start
$ cd deployment/docker-compose $ docker compose up -d
- Verify the installation
$ docker ps $ curl http://localhost
$ git clone https://github.com/EllisTheEllice/websocket-pong
$ cd websocket-pong/source
$ docker build -t pong-web .
$ docker run -p 80:8081 -d --name pong-web --network pongnet pong-web
In source/web/source folder you can find a config.json file. This file is used to set the port the NodeJS webserver listens to.