I’ve manage to fix but new error occured:
node:internal/modules/cjs/loader:1051
throw err;
^
Error: Cannot find module '/app/next'
at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
at Module._load (node:internal/modules/cjs/loader:901:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
at node:internal/main/run_main_module:23:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v20.6.0
This is the mounted files:
My Dockerfile:
version: '3.8'
services:
nextjs:
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/app
ports:
- "4000:4000"
depends_on:
- nextmysql
command: next start
nextmysql:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: nextdb
MYSQL_USER: user
MYSQL_PASSWORD: password
ports:
- "3306:3306"
nextphpmyadmin:
image: phpmyadmin/phpmyadmin
ports:
- '4080:80'
environment:
TZ: Asia/Manila
PMA_HOST: nextmysql
depends_on:
- nextmysql
