Developing a simple application with Docker.
Run it with:
docker run -d --name <name> -p 5000:5000 -v <yourdatadir>:/tmp -e ENVKEY=<yourvalue> -e MYSQL_HOST=<yourhost> -e MYSQL_PORT=<yourport> --net <networkname> <imagename>
Where:
name
is the name of the cointainer that will be createdyourdatadir
is the local directory containing your configuration fileyourvalue
is the value you want to give to the environment keynetworkname
is the name of the network to which this container will connect. WARNING: your mysql container must be connected to the same networkyourhost
is the name of the host running the mysql istanceyourport
is the port that exposes the mysql serviceimagename
is the name of the image created with the provided Dockerfile. Alternatively, you can useubaldopuocci/mypythonserver:latest
Then connect to localhost:5000
and verify that everything is working as expected.