boilerplate-lambda-container/containers/hello-openapi/GUIDE.md

48 lines
775 B
Markdown

# Guide
Build the docker image and run it locally. Or run the deno server directly:
Test the server locally
```sh
deno task start
```
Then open [http://localhost:8000/reference](http://localhost:8000/reference) in your browser.
Test an authenticated endpoint:
```sh
curl -H 'Authorization: Bearer hunter2' 127.0.0.1:8000/users/123
```
Update the Dockerfile with the latest SHA256 digests.
```sh
./update_dockerfile.sh hello-openapi
```
Build the docker image.
```sh
docker build -t hello-openapi .
```
Test the container image locally.
```sh
docker run -p 8000:8000 hello-openapi:latest
```
Stop it from another terminal tab.
```sh
docker stop $(docker ps -q)
```
Lock the updated image digests in the Dockerfile.
```sh
./lock_dockerfile.sh hello-openapi
```