# Set a light linux distro with node pre-installed as a starting point. #FROM node:16.14.0-alpine3.15 FROM node:18-alpine3.20 # Change working directory to your app final destination on image file structure. WORKDIR /nuxt3 # Copy dependencies instructions from local to image. #COPY package.json . COPY ./package*.json /nuxt3/ # Install dependencies # RUN npm install # RUN apt update RUN npm install -g npm@10.9.0 --unsafe-perm=true --allow-root RUN npm i -g nuxt #RUN npm config set legacy-peer-deps true RUN npm install # Copy all local project files to image. COPY . . # Designated to tell Nuxt to resolve a host address (Nuxt3 Docs) ENV HOST 0.0.0.0 # Override Chokidar pooling settings. It is important to make HMR work in WSL environment, ENV CHOKIDAR_USEPOLLING=true # Expose port 3000. Exposing a port in Dockerfile usually works a type of documentation between image and container authors. This port is actually published in the container settings described on docker-compose.yml. EXPOSE 3116 # RUN mkdir node_modules/.vite/deps_temp && chmod 777 -R node_modules && chmod 777 -R node_modules/.vite/deps_temp # Run Nuxt3 in development mode. CMD npm run dev