Angular app deploy

Dockerfile for Angular app deploy

Deployment error
ERROR COPY failed: stat /var/lib/docker/overlay2/51db8e8458f21e97e8f25f7224a633aa50d4937795790d3a410b32cf10663b55/merged/usr/src/dist: no such file or directory

I try to deploy my angular app. I had selected the Angular for application creation and I had created the Dockerfile with the below content.
Is there any issue in it?
Or should I select NodeJS when creating the application on the Qovery in this case?

(My another Qovery really NodeJS application works fine)

Sorry, I have limited knowledge about docker and nginx
Thanks!

Dockerfile content:
FROM node:13-alpine as build-step
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app
RUN npm install
COPY . /usr/src/app
RUN npm run build --qovery
FROM nginx:1.17.1-alpine
COPY --from=build-step /usr/src/dist /usr/share/nginx/html

Hello, here is the docker file I use for React app deployment. Not sure the build file name is the same but this one works perfectly.

I also remember that it’s not recommended to use alpine image, kind of buggy.

FROM node:13 as build
WORKDIR /app
COPY . ./
RUN npm i --only=prod
RUN npm run build

FROM nginx:1.19.0
COPY --from=build /app/build /usr/share/nginx/html
COPY ./nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

And the content of nginx.conf in the folder nginx.


server {
    listen 80;
    root /usr/share/nginx/html;
    index index.html index.htm;

    location / {
        try_files $uri /index.html;
    }

}
1 Like

Both contents were helpful for me.
Deploy is working now.
Thanks!

1 Like