Minimal Rust + PostgreSQL microservice using Actix Web. Containerised with Docker; includes Docker Compose and CI to Docker Hub.
docker compose up --build
# then visit:
# http://localhost:8000/usersImage is published on every push to main:
docker.io/grthomson/docker-rust-postgres:latest
Run it against a local Postgres:
docker run -p 8000:8000 \
-e PG_HOST=host.docker.internal \
-e PG_DBNAME=example \
-e PG_USER=postgres \
-e PG_PASSWORD=mysecretpassword \
grthomson/docker-rust-postgres:latest
GET /users – list users (migration seeds a root user)
GET /healthz – health check
- GitHub Actions builds & pushes Docker image to Docker Hub on each push to main.