File tree Expand file tree Collapse file tree 3 files changed +50
-1
lines changed Expand file tree Collapse file tree 3 files changed +50
-1
lines changed Original file line number Diff line number Diff line change 1+ # Rust build artifacts
2+ /target /
3+ ** /* .rs.bk
4+
5+ # Local dev files
6+ * .env
7+ * .log
8+
9+ # Docker stuff
10+ db-data /
11+ docker-rust-kubernetes.yaml
12+
13+ # Git
14+ .DS_Store
Original file line number Diff line number Diff line change 11# docker-rust-postgres
22
3- [ ![ CI] ( https://github.com/grthomson/docker-rust-postgres/actions/workflows/main.yaml /badge.svg?branch=main )] ( https://github.com/grthomson/docker-rust-postgres/actions/workflows/main.yaml )
3+ [ ![ CI] ( https://github.com/grthomson/docker-rust-postgres/actions/workflows/main.yml /badge.svg?branch=main )] ( https://github.com/grthomson/docker-rust-postgres/actions/workflows/main.yml )
44[ ![ Docker Pulls] ( https://img.shields.io/docker/pulls/grthomson/docker-rust-postgres.svg )] ( https://hub.docker.com/r/grthomson/docker-rust-postgres )
55[ ![ Image Size] ( https://img.shields.io/docker/image-size/grthomson/docker-rust-postgres/latest )] ( https://hub.docker.com/r/grthomson/docker-rust-postgres/tags )
66
77Minimal Rust + PostgreSQL microservice using Actix Web. Containerised with Docker; includes Docker Compose and CI to Docker Hub.
8+
9+ ## Quick start (Compose)
10+
11+ ``` bash
12+ docker compose up --build
13+ # then visit:
14+ # http://localhost:8000/users
15+ ```
16+
17+ ## Run from Docker Hub
18+
19+ Image is published on every push to main:
20+
21+ ``` docker.io/grthomson/docker-rust-postgres:latest ```
22+
23+ Run it against a local Postgres:
24+
25+ ```
26+ docker run -p 8000:8000 \
27+ -e PG_HOST=host.docker.internal \
28+ -e PG_DBNAME=example \
29+ -e PG_USER=postgres \
30+ -e PG_PASSWORD=mysecretpassword \
31+ grthomson/docker-rust-postgres:latest
32+ ```
33+
34+ ## Endpoints
35+
36+ ``` GET /users ``` – list users (migration seeds a ``` root ``` user)
37+
38+ ``` GET /healthz ``` – health check
39+
40+ ## CI/CD
41+
42+ - GitHub Actions builds & pushes Docker image to Docker Hub on each push to main.
You can’t perform that action at this time.
0 commit comments