

This section defines our Redis service, which opens port 6379 and uses the official Redis image on Docker Hub. The next service is the Postgres database, which opens port 5432 and uses the latest official Postgres image on Docker Hub.
#DOCKER RUN IMAGE LOCALLY CODE#
env, and mounts our local code directory as a volume.

It opens port 5000, sets environment variables defined in.

The first section defines the web service. The following is the docker-compose.yml for the application: Everything is defined in docker-compose.yml, which is used by the docker-compose CLI. You can use Docker Compose to define your local development environment, including environment variables, ports you need accessible, and volumes to mount. With Docker, the web frontend, Redis, and Postgres each run in a separate container. This example app is comprised of a web frontend, Redis for caching, and Postgres as our database. Let’s start out with a simple python-based multi-container application. In this article you’ll learn why Docker Compose is great for local development, how you can push your Docker images to Heroku for deployment, and Compose tips and tricks. Docker Compose is a tool for defining and running a multi-container Docker application.
