my docker file is as below
FROM node:16.16.0 as ui
WORKDIR /app
COPY ./ui/package.json .
RUN npm install
COPY ./ui/ .
WORKDIR /admin
COPY ./admin/package.json .
RUN npm install
COPY ./admin/ .
FROM ui as ui1
WORKDIR /app
RUN npm run build
WORKDIR /admin
RUN npm run build
FROM nginx
EXPOSE 3000 5001
COPY ./nginx/prod.conf /etc/nginx/conf.d/default.conf
COPY --from=ui1 /app/build /usr/share/nginx/html
COPY --from=ui1 /admin/build /usr/share/nginx/admin
Everything working fine as expected , but each time the eb deploy
is taking more than 4 minutes.Its a simple app with react hello world page.
First time its fine since it installs node , packages etc.. but second time if i just change some content in app and redeploy , again its taking 4 to 5 minutes.
I have tried eb deploy --staged
, it still takes same time.
Below is my docker compose
version: "3"
services:
backend:
build:
context: ./backend
volumes:
- /app/node_modules
- ./backend:/app
nginx:
volumes:
- ./nginx/prod.conf:/etc/nginx/conf.d/default.conf
restart: always
build:
context: ./
ports:
- "80:80"