technical-ivoryT
Refine2y ago
4 replies
technical-ivory

How to get live app updates during Dev time

Hi all, I finally decide to ask the question here after 2h of turning around without solution.

I've got a docker-compose.yml to initiate multiple apps (wp, api, strapi, refin, db, ...) and a Dockerfile in my refine app directory.

But I cannot find the way to work in a development mode with refine.
needs : when I update a file, the app should be update as well instantly

here is my dcoker-compose.yml for refine
refine_app:
    #build: ./app/komunityApp
    build: ./app/refine-project
    #x-develop:
    #  watch:
    #    - action: rebuild
    #      path: ./app/refine-project
    #command: sh -c "npm run build"
    volumes:
      #- ./app/komunityApp/app:/usr/src/app
      - ./app/refine-project:/usr/src
      - ./app/refine-project/app:/usr/src/app
    networks:
      - komunity_net
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.refineapp.rule=Host(`app.kom-unity.me`)"
      - "traefik.http.services.refineapp.loadbalancer.server.port=3000"

here is my dockerfile
FROM refinedev/node:18 AS base

FROM base as deps

COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./

RUN \
  if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
  elif [ -f package-lock.json ]; then npm ci; \
  elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
  else echo "Lockfile not found." && exit 1; \
  fi

#FROM base as builder
FROM base as dev

#ENV NODE_ENV production
ENV NODE_ENV development

COPY --from=deps /app/refine/node_modules ./node_modules

COPY . .

RUN npm run dev --host=app.kom-unity.me
#RUN npm run build

#FROM base as runner

#ENV NODE_ENV production
#ENV NODE_ENV development

#RUN npm install -g serve

#COPY --from=builder /app/refine/dist ./

#USER refine

#CMD ["serve"]
`

Can someone could help me to pass this dificulty, if you please ?
Was this page helpful?