|
1 |
| -### Building and running your application |
| 1 | +# grthomson/docker-rust-postgres |
2 | 2 |
|
3 |
| -When you're ready, start your application by running: |
4 |
| -`docker compose up --build`. |
| 3 | +Minimal Rust + PostgreSQL service (Actix Web). |
5 | 4 |
|
6 |
| -Your application will be available at http://localhost:8000. |
| 5 | +## Usage |
| 6 | +```bash |
| 7 | +docker pull grthomson/docker-rust-postgres:latest |
| 8 | +docker run -p 8000:8000 \ |
| 9 | + -e PG_HOST=host.docker.internal \ |
| 10 | + -e PG_DBNAME=example \ |
| 11 | + -e PG_USER=postgres \ |
| 12 | + -e PG_PASSWORD=mysecretpassword \ |
| 13 | + grthomson/docker-rust-postgres:latest |
| 14 | + ``` |
7 | 15 |
|
8 |
| -### Deploying your application to the cloud |
| 16 | +## Endpoints |
9 | 17 |
|
10 |
| -First, build your image, e.g.: `docker build -t myapp .`. |
11 |
| -If your cloud uses a different CPU architecture than your development |
12 |
| -machine (e.g., you are on a Mac M1 and your cloud provider is amd64), |
13 |
| -you'll want to build the image for that platform, e.g.: |
14 |
| -`docker build --platform=linux/amd64 -t myapp .`. |
15 |
| - |
16 |
| -Then, push it to your registry, e.g. `docker push myregistry.com/myapp`. |
17 |
| - |
18 |
| -Consult Docker's [getting started](https://docs.docker.com/go/get-started-sharing/) |
19 |
| -docs for more detail on building and pushing. |
20 |
| - |
21 |
| -### References |
22 |
| -* [Docker's Rust guide](https://docs.docker.com/language/rust/) |
| 18 | +```GET /users```, ```GET /healthz``` |
0 commit comments