[doc] update README.md
Browse files
README.md
CHANGED
|
@@ -17,16 +17,17 @@ Build the docker image this way:
|
|
| 17 |
docker stop $(docker ps -a -q); docker rm $(docker ps -a -q)
|
| 18 |
|
| 19 |
# build the base docker image with the ARG DEPENDENCY_GROUP=fastapi used by poetry
|
| 20 |
-
docker build . -f dockerfiles/dockerfile-samgis-base --build-arg DEPENDENCY_GROUP=fastapi
|
|
|
|
| 21 |
|
| 22 |
# build the image, use the tag "samgis-huggingface"
|
| 23 |
-
docker build . --tag
|
| 24 |
```
|
| 25 |
|
| 26 |
Run the container (keep it on background) and show logs
|
| 27 |
|
| 28 |
```bash
|
| 29 |
-
docker run -d --name samgis-huggingface -p 7860:7860
|
| 30 |
```
|
| 31 |
|
| 32 |
Test it with curl:
|
|
@@ -50,10 +51,11 @@ Build the docker image this way:
|
|
| 50 |
docker stop $(docker ps -a -q); docker rm $(docker ps -a -q)
|
| 51 |
|
| 52 |
# build the base docker image with the docker aws repository tag
|
| 53 |
-
docker build . -f dockerfiles/dockerfile-samgis-base --build-arg DEPENDENCY_GROUP=aws_lambda
|
|
|
|
| 54 |
|
| 55 |
# build the final docker image
|
| 56 |
-
docker build . -f dockerfiles/dockerfile-lambda-fastsam-api --tag
|
| 57 |
```
|
| 58 |
|
| 59 |
Run the container (keep it on background) and show logs
|
|
@@ -66,14 +68,11 @@ Test it with curl:
|
|
| 66 |
|
| 67 |
```bash
|
| 68 |
URL=http://localhost:8080/2015-03-31/functions/function/invocations
|
| 69 |
-
curl -
|
| 70 |
-
${URL} \
|
| 71 |
-
-H 'accept: application/json' \
|
| 72 |
-
-d '{}'
|
| 73 |
```
|
| 74 |
|
| 75 |
### Publish the aws lambda docker image
|
| 76 |
-
Login on aws ECR with the correct aws profile (change the example `
|
| 77 |
the [ECR push command instructions page](https://eu-west-1.console.aws.amazon.com/ecr/repositories/)).
|
| 78 |
|
| 79 |
### Dependencies installation and local tests
|
|
|
|
| 17 |
docker stop $(docker ps -a -q); docker rm $(docker ps -a -q)
|
| 18 |
|
| 19 |
# build the base docker image with the ARG DEPENDENCY_GROUP=fastapi used by poetry
|
| 20 |
+
docker build . -f dockerfiles/dockerfile-samgis-base --build-arg DEPENDENCY_GROUP=fastapi \
|
| 21 |
+
--tag example-docker-namespace/samgis-base-fastapi --progress=plain
|
| 22 |
|
| 23 |
# build the image, use the tag "samgis-huggingface"
|
| 24 |
+
docker build . --tag example-docker-namespace/samgis-huggingface --progress=plain
|
| 25 |
```
|
| 26 |
|
| 27 |
Run the container (keep it on background) and show logs
|
| 28 |
|
| 29 |
```bash
|
| 30 |
+
docker run -d --name samgis-huggingface -p 7860:7860 example-docker-namespace/samgis-huggingface; docker logs -f samgis-huggingface
|
| 31 |
```
|
| 32 |
|
| 33 |
Test it with curl:
|
|
|
|
| 51 |
docker stop $(docker ps -a -q); docker rm $(docker ps -a -q)
|
| 52 |
|
| 53 |
# build the base docker image with the docker aws repository tag
|
| 54 |
+
docker build . -f dockerfiles/dockerfile-samgis-base --build-arg DEPENDENCY_GROUP=aws_lambda \
|
| 55 |
+
--tag example-docker-namespace/samgis-base-aws-lambda --progress=plain
|
| 56 |
|
| 57 |
# build the final docker image
|
| 58 |
+
docker build . -f dockerfiles/dockerfile-lambda-fastsam-api --tag example-docker-namespace/lambda-fastsam-api --progress=plain
|
| 59 |
```
|
| 60 |
|
| 61 |
Run the container (keep it on background) and show logs
|
|
|
|
| 68 |
|
| 69 |
```bash
|
| 70 |
URL=http://localhost:8080/2015-03-31/functions/function/invocations
|
| 71 |
+
curl -d@./events/payload_point_eolie.json -H 'accept: application/json' ${URL}
|
|
|
|
|
|
|
|
|
|
| 72 |
```
|
| 73 |
|
| 74 |
### Publish the aws lambda docker image
|
| 75 |
+
Login on aws ECR with the correct aws profile (change the example `example-docker-namespace/` repository url with the one from
|
| 76 |
the [ECR push command instructions page](https://eu-west-1.console.aws.amazon.com/ecr/repositories/)).
|
| 77 |
|
| 78 |
### Dependencies installation and local tests
|