Run Rediflow with Podman or Docker
This howto gets the build artefact (container image) and database running using the Dockerfile and compose file, with optional Makefile targets.
Both Podman and Docker are supported. Use make DOCKER=1 build and make DOCKER=1 up for Docker. The compose files work with either runtime.
What you need
- Podman (rootless or root) with Compose: either
podman-composeor Podman 4.1+ with built-inpodman compose. - One compose file (
compose.yml) defines:- db: PostgreSQL 18 (Alpine), persistent volume, healthcheck.
- app (profile
dev): Flask dev server, built from Dockerfile. - app-qa (profile
qa): Gunicorn WSGI, same image.
No extra compose files are required; profiles select which app mode runs.
One-time setup
-
Env files (so the app and compose know DB credentials and app settings):
- Copy
.env.dev.example→.env.dev(and optionally.env.qa.example→.env.qafor QA). - Create
.envwithPOSTGRES_USER,POSTGRES_PASSWORD, andPOSTGRES_DBmatching.env.dev(or.env.qafor QA). Compose loads.envby default and uses these to buildDATABASE_URLfor the app container. - When running inside compose,
DATABASE_URLhost is overridden todbby compose; you only need correctPOSTGRES_*/DATABASE_URLfor the values used incompose.yml.
- Copy
-
Build the image (build artefact):
make buildOr without Make:
podman compose build. This produces the imagerediflow:latestused by both dev and QA services.
Run app + database
-
Dev (Flask):
make upOr:
podman compose up -d db app. App at http://localhost:5000. -
QA (Gunicorn):
make up-qaOr:
podman compose up -d db app-qa. -
Database only (run app on host, DB in container):
make up-dbUses
compose.db-only.ymlso only PostgreSQL starts. Then setDATABASE_URL=postgresql://rediflow:rediflow@localhost:5432/rediflowin.env.devand runuv run rediflow run(or similar) on the host.
Note: Podman Compose with --profile support is required for migrate scripts and dev/qa profile. The Makefile uses service names (db, app, app-qa) for up.
Migrations
After the database is up (via make up-db or make up / make up-qa), run:
make migrate
This runs a one-off rediflow:latest container on the same network as the db (using podman run), so it works whether the db was started with compose.db-only.yml or compose.yml.
Stop
make down
Stops app (if started with dev/qa profile) and the database.
Using Docker instead of Podman
Both Podman and Docker are fully supported. Set DOCKER=1 so the Makefile uses docker compose:
make DOCKER=1 build
make DOCKER=1 up
The same compose files and Dockerfile work with either runtime.
Summary: do we need more than compose files?
- compose.yml defines DB + app (dev) + app-qa (qa). Use
up -d db apporup -d db app-qato start the stack you need. - compose.db-only.yml defines only the DB (same image and volume); used by
make up-dbso only PostgreSQL runs. - Dockerfile builds the single app image
rediflow:latestused by both app services. - Makefile gives a single entry point:
make build,make up,make migrate,make down. Migrate usespodman runso it works with either compose file.
The build artefact is the image rediflow:latest; the database uses the named volume rediflow_pgdata.
For QA or production using the pre-built image from the registry (no local build), see Deploy QA and production.