From b19122f55ed23c8ef3f817abc439bef391209025 Mon Sep 17 00:00:00 2001 From: Cristopher Pinzon Date: Wed, 24 Jan 2024 13:18:21 -0500 Subject: [PATCH] fix version, delete unused file and update compose file --- README.md | 2 +- docker-compose.yml | 23 ++++++++++------------- example/service/test/serverless.yml | 2 -- package-lock.json | 2 +- package.json | 2 +- src/index.js | 2 +- 6 files changed, 14 insertions(+), 19 deletions(-) delete mode 100644 example/service/test/serverless.yml diff --git a/README.md b/README.md index 81d1464..1dd5513 100644 --- a/README.md +++ b/README.md @@ -208,7 +208,7 @@ custom: ``` ## Change Log -* v1.2.1: Add docker_compose config and fix autostart when plugin is not active +* v1.2.0: Add docker-compose config and fix autostart when plugin is not active * v1.1.3: Fix replacing host from environment variable `AWS_ENDPOINT_URL` * v1.1.2: Unify construction of target endpoint URL, add support for configuring `AWS_ENDPOINT_URL` * v1.1.1: Fix layer deployment if `mountCode` is enabled by always packaging and deploying diff --git a/docker-compose.yml b/docker-compose.yml index a046248..cdc4442 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,18 +1,15 @@ -version: '2' +version: "3.8" + services: localstack: + container_name: "${LOCALSTACK_DOCKER_NAME:-localstack-main}" image: localstack/localstack ports: - - "4567-4582:4567-4582" - - "8080:8080" + - "127.0.0.1:4566:4566" # LocalStack Gateway + - "127.0.0.1:4510-4559:4510-4559" # external services port range environment: - # Only start a subset of services required for testing. - - SERVICES=s3,sns,sqs,apigateway,lambda,dynamodb,dynamodbstreams,cloudformation - # - DEBUG=${DEBUG- } - # - DATA_DIR=${DATA_DIR- } - # - LAMBDA_EXECUTOR=${LAMBDA_EXECUTOR- } - # - KINESIS_ERROR_PROBABILITY=${KINESIS_ERROR_PROBABILITY- } - # - DOCKER_HOST=unix:///var/run/docker.sock - # volumes: - # - "${TMP_DIR:-/tmp/localstack}:${TMP_DIR:-/tmp/localstack}" - # - "/var/run/docker.sock:/var/run/docker.sock" + # LocalStack configuration: https://docs.localstack.cloud/references/configuration/ + - DEBUG=${DEBUG:-0} + volumes: + - "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack" + - "/var/run/docker.sock:/var/run/docker.sock" diff --git a/example/service/test/serverless.yml b/example/service/test/serverless.yml deleted file mode 100644 index e31ae3d..0000000 --- a/example/service/test/serverless.yml +++ /dev/null @@ -1,2 +0,0 @@ -component: test -inputs: diff --git a/package-lock.json b/package-lock.json index 4010254..f4ed869 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "serverless-localstack", - "version": "1.2.1", + "version": "1.2.0", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 280b02f..405b804 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "serverless-localstack", - "version": "1.2.1", + "version": "1.2.0", "description": "Connect Serverless to LocalStack!", "main": "src/index.js", "scripts": { diff --git a/src/index.js b/src/index.js index 2bd943f..cfb30f9 100644 --- a/src/index.js +++ b/src/index.js @@ -406,7 +406,7 @@ class LocalstackPlugin { * Start the LocalStack container in Docker, if it is not running yet. */ startLocalStack() { - if (!this.config.autostart || !this.isActive()) { + if (!(this.config.autostart && this.isActive())) { return Promise.resolve(); }