<!-- Love localstack? Please consider supporting our collective:
👉  https://opencollective.com/localstack/donate -->

# Type of request: This is a ...
* [x] bug report
* [ ] feature request

# Detailed description
Lambda invocation works in macos but fails in github actions:

### docker-compose.yml
```
version: '3.1'

services:
  localstack:
    image: localstack/localstack:latest
    environment:
      - AWS_DEFAULT_REGION=us-east-1
      - LAMBDA_EXECUTOR=docker
      - DEBUG=1
      - EDGE_PORT=4566
      - SERVICES=lambda,s3,cloudformation,sts,apigateway,iam,route53
      - DATA_DIR=/tmp/localstack/data
    ports:
      - '4566-4597:4566-4597'
    volumes:
      - "./localstacktemp:/tmp/localstack"
      - "/var/run/docker.sock:/var/run/docker.sock"
      - ./aws:/docker-entrypoint-initaws.d
    networks:
      - test
```

### serverless.yml
```
service: doctor-local

frameworkVersion: '2'

plugins:
  - serverless-localstack

custom:
  localstack:
    debug: true
    stages:
      - local
      - dev
    endpointFile: localstack_endpoints.json

provider:
  name: aws
  runtime: nodejs12.x

functions:
  hola:
    handler: handler.hello
    memorySize: 256
    timeout: 900
    events:
    - http:
        path: svc/ping
        method: get
    - http:
        path: svc/jobs
        method: get
```

### localstack_endpoints.json
```
{
    "CloudFormation" : "http://localhost:4566",
    "CloudWatch" : "http://localhost:4566",
    "Lambda" : "http://localhost:4566",
    "S3" : "http://localhost:4566",
    "APIGateway" : "http://localhost:4566",
    "Route53" : "http://localhost:4566"
}
```

### Invocation result (In my local) (success)
```
{
    "status": 200,
    "message": "I got invoked and returning you this response"
}
```

### Invocation result (In Github actions run - ubuntu-latest) (Error)
```
{
      errorType: 'InvocationException',
      errorMessage: 'Lambda process returned error status code: 1. Result: ' +
        '{"errorType":"Runtime.ImportModuleError","errorMessage":"Error: ' +
        "Cannot find module 'handler'\\nRequire stack:\\n- " +
        '/var/runtime/UserFunction.js\\n- /var/runtime/index.js"}. Output:\n' +
        "Unable to find image 'lambci/lambda:nodejs12.x' locally\nnodejs12.x: " +
        'Pulling from lambci/lambda\nb8f7c23f9c29: Pulling fs layer\n' +
        'c061d4866919: Pulling fs layer\naacc65296390: Pulling fs layer\n' +
        'aacc65296390: Verifying Checksum\naacc65296390: Download complete\n' +
        'c061d4866919: Verifying Checksum\nc061d4866919: Download complete\n' +
        'b8f7c23f9c29: Verifying Checksum\nb8f7c23f9c29: Download complete\n' +
        'b8f7c23f9c29: Pull complete\nc061d4866919: Pull complete\naacc65296390: ' +
        'Pull complete\nDigest: ' +
        'sha256:098709a2d12098c2ab5ad45138a2f97d3acc1788c2855b3659dd20eed62fd2af\n' +
        'Status: Downloaded newer image for lambci/lambda:nodejs12.x\n' +
        '2021-03-04T06:52:16.506Z\tundefined\tERROR\tUncaught Exception \t' +
        '{"errorType":"Runtime.ImportModuleError","errorMessage":"Error: ' +
        "Cannot find module 'handler'\\nRequire stack:\\n- " +
        '/var/runtime/UserFunction.js\\n- ' +
        '/var/runtime/index.js","stack":["Runtime.ImportModuleError: Error: ' +
        `Cannot find module 'handler'","Require stack:","- ` +
        '/var/runtime/UserFunction.js","- /var/runtime/index.js","    at ' +
        '_loadUserApp (/var/runtime/UserFunction.js:100:13)","    at ' +
        'Object.module.exports.load (/var/runtime/UserFunction.js:140:17)","   ' +
        ' at Object.<anonymous> (/var/runtime/index.js:43:30)","    at ' +
        'Module._compile (internal/modules/cjs/loader.js:999:30)","    at ' +
        'Object.Module._extensions..js ' +
        '(internal/modules/cjs/loader.js:1027:10)","    at Module.load ' +
        '(internal/modules/cjs/loader.js:863:32)","    at ' +
        'Function.Module._load (internal/modules/cjs/loader.js:708:14)","    ' +
        'at Function.executeUserEntryPoint [as runMain] ' +
        '(internal/modules/run_main.js:60:12)","    at ' +
        'internal/main/run_main_module.js:17:47"]}\n\u001b[32mSTART RequestId: ' +
        '51b7e5dd-7f1a-15c2-efd3-5bb4aad84560 Version: $LATEST\u001b[0m\n\u001b[32mEND ' +
        'RequestId: 51b7e5dd-7f1a-15c2-efd3-5bb4aad84560\u001b[0m\n\u001b[32mREPORT ' +
        'RequestId: 51b7e5dd-7f1a-15c2-efd3-5bb4aad84560\tInit Duration: 135.74 ' +
        'ms\tDuration: 1.52 ms\tBilled Duration: 2 ms\tMemory Size: 1536 MB\tMax ' +
        'Memory Used: 48 MB\t\u001b[0m',
      stackTrace: [Array]
    }
```
I'm pretty sure the path to handler is valid because it works in my mac
...

## Expected Behavior
Lambda should be invoked in github actions as well
...

## Actual behavior
Lambda InvocationError
...

# Steps to reproduce
* docker-compose up
* SLS_DEBUG=* node_modules/.bin/serverless deploy --stage local
```
% node_modules/.bin/serverless --version                                         
Framework Core: 2.15.0 (local)
Plugin: 4.4.3
SDK: 2.3.2
Components: 3.7.2

% node -v
v12.4.0

Versions:
"serverless": "2.15.0",
"serverless-localstack": "0.4.28",
```

## Command used to start LocalStack
docker-compose up
...
## Client code (AWS SDK code snippet, or sequence of "awslocal" commands)
```
Making api call to
http://localhost:4566/restapis/%7BrestapiId%7D/local/_user_request_/svc/ping
```
...
""" Parses the environment variable $SERVICES with a comma-separated list of services
        and (optional) ports they should run on: 'service1:port1,service2,service3:port3' """
    service_ports = os.environ.get('SERVICES', '').strip()
    if not service_ports:
        return DEFAULT_SERVICE_PORTS
    result = {}
    for service_port in re.split(r'\s*,\s*', service_ports):
        parts = re.split(r'[:=]', service_port)
        service = parts[0]
        key_upper = service.upper().replace('-', '_')
        port_env_name = '%s_PORT' % key_upper
        
        port_number = DEFAULT_SERVICE_PORTS.get(service)
        
        if os.environ.get(port_env_name):
            port_number = os.environ.get(port_env_name)
        
        if len(parts) > 1:
            port_number = int(parts[-1])
        
        try:
            port_number = int(port_number)
        except Exception:
            port_number = 0
        result[service] = port_number
    return result
def populate_configs(service_ports=None):