i have finished my work on an angular project and i need to deploy it using docker , i followed the instructions and made sure that the dockerfile is correct using multiple sources .
i tried to use either nginx or nodejs but it doesnt work(for nginx it shows me the default page of nginx server).here is the dockerfile i use righ now to create the image:
# Stage 1: Build Angular application
FROM node:latest as build
WORKDIR /app
COPY package*.json ./
RUN npm install
RUN npm install -g @angular/cli
COPY . .
RUN ng build --configuration=production
# Stage 2: Serve Angular application with Nginx
FROM nginx:latest
COPY --from=build /app/dist/projet-daret /usr/share/nginx/html
EXPOSE 80
Note: i have a Dockerfile for a version that uses nodejs as web server.
when i use the docker with just the angular app and run it with ng serve it works fine, but when i use nginx or nodejs it doesn’t run the angular app, i tried multiple modifications i could find for the docker file but no result, i tried event to use compose but it yielded no result also. i am stuck right now.
Soye Gh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.