Skip to content

Project to demonstrate using Docker to setup and configure servers to run simple web application

Notifications You must be signed in to change notification settings

skipluck/bestsongs-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Best Songs (Docker)

Project to demonstrate using Docker to:

  • Build nginx:alpine web container that acts as reverse proxy and forwards requests to application server
  • Build python3:alpine app container that deploys python code to query random random song from list of 100 songs store in mysql database
  • Use docker-compose to build app, web and database containers and expose port 80 to host system

Best Songs (Docker)

Prerequisites

Cloning this project from github

git clone https://github.com/skipluck/bestsongs-docker

Change file permissions (only for Play with Docker)

chmod 644 /root/bestsongs-docker/db/dbdump.sql

Executing Docker Componse

cd bestsongs-docker
docker-compose up -d

Using curl to test

curl localhost

run the command again to display a different random song

Testing via browser

Launch browser on host system and naviate to http://localhost. Refresh the page to display a different random song

Testing on Play with Docker

Launch browser on host system and use the following URL pattern http://ip<hyphen-ip>-<session_jd>-<port>.direct.labs.play-with-docker.com (i.e: http://ip172-18-0-10-bc23mf7ndhl000d01gm0.direct.labs.play-with-docker.com/). Refresh the page to display a different random song

Stopping the application

docker-compose stop

About

Project to demonstrate using Docker to setup and configure servers to run simple web application

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages