ClassicPhoto hero with four cards — portfolio default
StudioCentered brand, split hero, side-by-side home rows
MinimalCompact header, title hero, flat cards
EditorialTop-aligned hero, wide headline, magazine home rhythm
SpotlightCentered cinematic hero, glass header, narrow home column
DefaultRefined portfolio blue — ships with the site
SlateSteel blue-grey for professional services
OceanRefined teal for SaaS and cloud brands
ForestGrounded green for health and sustainability
SageMuted sage for wellness and calm brands
PlumDusty plum for creative and advisory brands
Warm StudioSoft amber for founder-led creative brands
CopperRose copper for boutique and luxury SMB brands
Dockers
Dockers 101 – Series 2 of N – Using Dockerfile to Run a Tic Tac Toe Game in Python
Requirement: To run a Tic Tack Toe which is written in Python Strategy: Docker uses a Dockerfile to define what all will be going in a container For […]
Docker uses a Dockerfile to define what all will be going in a container
For above requirement we need the following:
a Python runtime
a working directory with the Python file
a command to execute the Python file
build the app
push the container to Docker Hub( you will need to create Docker Hub account and a repository under the account, Please visit hub.docker.com)
pull the image
run the container
Solution:
Login to your Host machine(in my case a CentOS 7 machine)
Make a directory “TicTackToe” and go to the directory – mkdir TicTackToe && cd TicTackToe
Download my Python Tic Tack Toe game from here – wget https://testbucket786786.s3.amazonaws.com/python/TictacToe.py
Now create a Dockerfile and copy the following content into it – nano Dockerfile
Copy following content into the Dockerfile and save:
The docker file has self explanatory explanations as what it is doing:
# Use an official Python runtime as a parent imageFROM python:2.7-slim# Set the working directory to /appWORKDIR /app# Copy the current directory contents into the container at /appADD . /app# Run TicTacToe.py when the container launchesCMD ["python", "TicTacToe.py"]
Now build the app(naeemstictactoelatest is the image name you want for this app)- docker build -t naeemstictactoelatest .
Now check for the image name for your app and tag it for pushing it to Docker Hub
docker images # to check for image name
docker tag image username/repository:tag # for tagging