U03-01.TodoAPI-SetupDockerCE
Exercise: Setup PostgreSQL on Docker CE (not Desktop)
Goal
Run a Postgres instance in Docker Engine - Community and verify connectivity.
Tasks
-
Install Docker CE (Engine) on Linux (Ubuntu/Debian recommended).
-
In the case you use Windows, let setup WSL
-
Verify with:
docker --version
docker info | grep -E "Server|Engine|Community"
docker compose version # plugin v2 preferred -
Acceptance proof:
docker infoshowsServer: Docker Engine - Community. Any evidence of “Docker Desktop” = fail.
-
-
Start PostgreSQL via Docker Compose (or docker run)
- Create
docker-composefile with some basic information:
image: postgres:16-alpine
container_name: todo_db
Some environment configs (user/pass) - Create
-
Verify database connectivity
- From host or a psql client container:
docker exec -it todo_db psql -U todo_user -d todo_db -c "\dt"
- From host or a psql client container:
Acceptance Criteria
- Evidence
docker infoshows Community (CE). - Postgres container healthy (
docker ps, healthcheck passing). - Can run
SELECT 1against the DB.
Deliverables
- Screenshot/log of
docker infoindicating CE, container status, and a successful query.
Rubric (30 pts)
- Docker CE installed & verified
- Postgres container running & healthy
- Connectivity verified