Serverless.yml not creating dynamodb table locally

I have a docker setup that runs serverless and dynamodb both in docker. In my serverless.yml I defined instructions for creating a table, yet when I run docker compose up it does not create the table (I’ve checked by running a query to list tables.

...
provider:
  name: aws
  runtime: nodejs8.10
  stage: dev
  region: eu-west-1

plugins:
  - serverless-dynamodb-local
  - serverless-offline

custom:
  dynamodb:
    inMemory: true
    port: 8000
    migrate: true # create tables on start
    onStart: true
  serverless-offline:
    babelOptions:
      presets: ["es2015"]

resources:
  Resources:
    UserTable:
      Type: "AWS::DynamoDB::Table"
      Properties:
        TableName: UserTable
        AttributeDefinitions:
          - AttributeName: userId
            AttributeType: S
          - AttributeName: fullname
            AttributeType: S
        KeySchema:
          - AttributeName: userId
            KeyType: HASH
        ProvisionedThroughput:
          ReadCapacityUnits: 1
          WriteCapacityUnits: 1
docker-compose.yml
version: "3"

services:
  serverless:
    build: .
    restart: always
    privileged: true
    working_dir: /home/node-app
    environment:
      - NODE_ENV=development
      - DYNAMO_ENDPOINT=http://dynamodb:8000
      - AWS_ACCESS_KEY_ID='dev-key-id'
      - AWS_SECRET_ACCESS_KEY='dev-key'
      - AWS_REGION='eu-west-1'
    links:
      - "dynamodb:dynamodb"
    command: npm run start
  ....
  dynamodb:
    image: amazon/dynamodb-local
    ports:
      - "8000:8000"
    environment:
      - AWS_ACCESS_KEY_ID='dev-key-id'
      - AWS_SECRET_ACCESS_KEY='dev-key'

npm run start simply runs sls offline . Once I run the docker compose, everything starts up fine but the UserTable is not created.

I’m sorry, I do not know the answer to your query, but I want to thank you for making me understand the use of “migrate”, I was searching for hours, on why the table was not being created for me.

turns out I missed migrate: true