So I have been trying to figure this out for a while now. I am working with node and next.js, to implement WEBRTC using socket.io. I containerized my project and it runs fine on my local machine, I uploaded it on ec2 by watching a youtube tutorial, and whenever I run the task/container it stops with these logs results. says cannot find 'pages' directory which i did initialize in compose file.
docker-compose.yml
version: '3'
services:
app:
image: webrtc
build: .
ports:
- 3000:3000
volumes:
- ./pages:/app/pages
- ./public:/app/public
- ./styles:/app/styles
- ./hooks:/app/hooks
Dockerfile
FROM node:16-alpine
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install
COPY next.config.js ./next.config.js
CMD ["yarn", "dev"]