containerize Flask app, PostgreSQL and Redis.
remember to create you own environment variable folder /env/app.env & /env/db.env
- Creating a
Dockerfileto containerize the Flask app, use bind mound volume to in sure if change in app.py occurs don't need to rebuild image. - Writing a
docker-compose.ymlfile to orchestrate the app, PostgreSQL(use named volume to store data persistently), and Redis.
how to run
run: docker-compose up -d --build
test: curl http://localhost/health
the result should be:
- "connected to both redis and database" Good
- "connected to database" Error
- "connected to redis" Error