### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

There's no way to explicitly toggle the `-inMemory` flag for DynamoDB - it relies on [`db_path` being unset](https://github.com/localstack/localstack/blob/v1.0.1/localstack/services/dynamodb/server.py#L45). However, `db_path` is always set because it [relies on config.dirs.data](https://github.com/localstack/localstack/blob/v1.0.1/localstack/services/dynamodb/server.py#L107-L113), which is [always set](https://github.com/localstack/localstack/blob/v1.0.1/localstack/config.py#L119).

### Expected Behavior

Maybe have an explicit env var like `DYNAMODB_IN_MEMORY` to force `-inMemory` mode or fix the path based logic in which it can be enabled.

Use case: I'm running tests on an ephemeral localstack container and don't need persistence. I think I'm experiencing the performance hit in https://github.com/localstack/localstack/issues/1205 and `-inMemory` seems be significantly faster.

### How are you starting LocalStack?

With a docker-compose file

### Steps To Reproduce

`docker-compose.yml`
```yaml
version: '3.8'
services:
  localstack:
    image: localstack/localstack:1.0
    environment:
      - EDGE_PORT=4566
      - EAGER_SERVICE_LOADING=1
      - SERVICES=dynamodb
      - PERSISTENCE=0
```

```
$ docker-compose up
...
localstack_1      | 2022-07-23T05:27:50.506  INFO --- [   Thread-12] l.services.dynamodb.server : Initializing DynamoDB Local with the following configuration:
localstack_1      | 2022-07-23T05:27:50.506  INFO --- [   Thread-12] l.services.dynamodb.server : Port:	34585
localstack_1      | 2022-07-23T05:27:50.506  INFO --- [   Thread-12] l.services.dynamodb.server : InMemory:	false
localstack_1      | 2022-07-23T05:27:50.506  INFO --- [   Thread-12] l.services.dynamodb.server : DbPath:	/var/lib/localstack/tmp/state/dynamodb
localstack_1      | 2022-07-23T05:27:50.506  INFO --- [   Thread-12] l.services.dynamodb.server : SharedDb:	false
localstack_1      | 2022-07-23T05:27:50.506  INFO --- [   Thread-12] l.services.dynamodb.server : shouldDelayTransientStatuses:	false
localstack_1      | 2022-07-23T05:27:50.506  INFO --- [   Thread-12] l.services.dynamodb.server : CorsParams:	*
...
```

### Environment

```markdown
- OS: Docker on Mac M1
- LocalStack: 1.0.1
```


### Anything else?

_No response_
DISABLE_CUSTOM_CORS_S3 = is_env_true("DISABLE_CUSTOM_CORS_S3")
DISABLE_CUSTOM_CORS_APIGATEWAY = is_env_true("DISABLE_CUSTOM_CORS_APIGATEWAY")
EXTRA_CORS_ALLOWED_HEADERS = os.environ.get("EXTRA_CORS_ALLOWED_HEADERS", "").strip()
EXTRA_CORS_EXPOSE_HEADERS = os.environ.get("EXTRA_CORS_EXPOSE_HEADERS", "").strip()
EXTRA_CORS_ALLOWED_ORIGINS = os.environ.get("EXTRA_CORS_ALLOWED_ORIGINS", "").strip()
DISABLE_PREFLIGHT_PROCESSING = is_env_true("DISABLE_PREFLIGHT_PROCESSING")
DISABLE_EVENTS = is_env_true("DISABLE_EVENTS")
DEBUG_ANALYTICS = is_env_true("DEBUG_ANALYTICS")
EAGER_SERVICE_LOADING = is_env_true("EAGER_SERVICE_LOADING")
MULTI_ACCOUNTS = is_env_true("MULTI_ACCOUNTS")
SKIP_INFRA_DOWNLOADS = os.environ.get("SKIP_INFRA_DOWNLOADS", "").strip()
SKIP_SSL_CERT_DOWNLOAD = is_env_true("SKIP_SSL_CERT_DOWNLOAD")
MAIN_CONTAINER_NAME = os.environ.get("MAIN_CONTAINER_NAME", "").strip() or "localstack_main"
LOCALSTACK_BUILD_GIT_HASH = os.environ.get("LOCALSTACK_BUILD_GIT_HASH", "").strip() or None
LOCALSTACK_BUILD_DATE = os.environ.get("LOCALSTACK_BUILD_DATE", "").strip() or None
OUTBOUND_HTTP_PROXY = os.environ.get("OUTBOUND_HTTP_PROXY", "")
OUTBOUND_HTTPS_PROXY = os.environ.get("OUTBOUND_HTTPS_PROXY", "")
ARN_PARTITION_REWRITING = is_env_true("ARN_PARTITION_REWRITING")
FORCE_SHUTDOWN = is_env_not_false("FORCE_SHUTDOWN")
MOCK_UNIMPLEMENTED = is_env_true("MOCK_UNIMPLEMENTED")
no_proxy = ",".join([LOCALSTACK_HOSTNAME, LOCALHOST, LOCALHOST_IP, "[::1]"])
if os.environ.get("no_proxy"):
    os.environ["no_proxy"] += "," + no_proxy
elif os.environ.get("NO_PROXY"):
    os.environ["NO_PROXY"] += "," + no_proxy
else:
    os.environ["no_proxy"] = no_proxy
CLI_COMMANDS = {}
if not DOCKER_BRIDGE_IP:
    DOCKER_BRIDGE_IP = "172.17.0.1"