version: "3"
services:
  build:
    image: node:alpine 
    working_dir: /home/node/app
    environment:
      - NODE_ENV=production
    volumes:
      - ./:/home/node/app
    command: "yarn && yarn build:production"

version: "3"
services:
  build:
    image: node:alpine 
    working_dir: /home/node/app
    environment:
      - NODE_ENV=production
    volumes:
      - ./:/home/node/app
    command: "rm -rf /home/node/app/public && yarn && yarn build:production"

Clean build directory when deploying.
Clean build directory when deploying.
