From 984a8aed4e4351f821848fd8751cf822fd81ab81 Mon Sep 17 00:00:00 2001 From: Geoffrey Booth Date: Wed, 1 Nov 2017 11:06:43 -0700 Subject: [PATCH] Example for docker-compose --- README.md | 2 +- docker-compose.yaml | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 docker-compose.yaml diff --git a/README.md b/README.md index 1a10af8..60785e8 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ $ docker run -it --rm \ This will add your current directory as a volume to the container and publish host port to container port. -For a working example please take a look at the [Makefile](https://github.com/cnadiminti/docker-aws-sam-local/blob/master/Makefile) in the source repository. +For working examples please take a look at the [`Makefile`](https://github.com/cnadiminti/docker-aws-sam-local/blob/master/Makefile) and [`docker-compose.yaml`](https://github.com/cnadiminti/docker-aws-sam-local/blob/master/docker-compose.yaml) files in the source repository. Note that `PWD` above should resolve to a path on the host (the machine running Docker), not something within a Docker container. ## License diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..1dfe8c4 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,11 @@ +version: '3' + +services: + aws-sam-local: + image: cnadiminti/aws-sam-local + command: local start-api --docker-volume-basedir "$PWD/example" --host 0.0.0.0 + ports: + - '3000:3000' + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - ./example:/var/opt