0

this is my Dockerfile

# Use official node image as the base image
FROM node:latest as build

# Set the working directory
WORKDIR /usr/local/app

# Add the source code to app
COPY ./ /usr/local/app/

# Install all the dependencies
RUN npm install

# Generate the build of the application
RUN npm run build


# Stage 2: Serve app with nginx server

# Use official nginx image as the base image
FROM nginx:latest

# Copy the build output to replace the default nginx contents.
COPY --from=build /usr/local/app/dist/myapp /usr/share/nginx/html

When I run the docker build command to create the docker image, I get this error:

ERROR [build 5/5] RUN npm run build Error: src/app/components/page/page-dashboard/page-dashboard.component.html:12:21 - error NG8001: 'app-map' is not a known element

This error occurs just for six components. (e.g. app-map trigger an error, app-map-filter doesn't trigger an error)

P.s The application works fine with npm start and npm build. The problem occurs just with the dockerization.

Do you have any ideas?

0 Answers0