yarn server with docker-compose
yarn start should be the CMD of your docker image (I.e what is run when you start a container) and not a RUN command (which is run when creating the image used to satrt a container later)
From your exemple, something like this should be better:
 FROM node:12-alpine
 
 WORKDIR /app
 COPY ./server /app
 
 WORKDIR /app/server
 RUN yarn
 CMD yarn start