Coder Social home page Coder Social logo

snake-container's Introduction

Running a snake-game in a Docker Container

This repository contains all the files required to a simple snake game in a docker container.

Snake game overview

This is a snake game which can be accessed using a web browser. It's made up of a css, js, and an index.html file.

Getting started:

Building an image

Make sure the Docker service is up and running on your local machine or your Cloud instance. Build an image based on the dockerfile present in the master folder.

Command: docker build -t snake-game .

-t is used to name the image. Here the name is "snake-game".

Starting a container

Start a container using an image that's recently created.

command: docker run -d -p 80:80 --name snake-game .

. tells the command to look for the dockerfile in this location. port 80 has been used on the host and also on the container for the app to run. Change the host port to any other port as per your requirement.

Verifying results

Once the container is up and running, open a web browser and type in either container_ip/index.html or localhost/index.html and check the results. Click on the start button to start the snake game.

snake-container's People

Contributors

rahulgadre avatar olicsadoerr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.