daily-code icon indicating copy to clipboard operation
daily-code copied to clipboard

docker integration with bind mounts

Open Akash1000x opened this issue 1 year ago • 5 comments

PR Fixes: #139

I've successfully integrated Bind mounts with docker-compose file. when running 'docker compose watch', if we change any file and save it, the docker image is hot-reloaded.

@hkirat please review and notify me if any change is needed.

Checklist before requesting a review

  • [X] I have performed a self-review of my code

Akash1000x avatar Apr 17 '24 19:04 Akash1000x

@Akash1000x I have already added this feature refer #111

fasal26 avatar Apr 18 '24 09:04 fasal26

@fasal26 in my pr i added bind mounts using the Compose Watch feature, you don't need to go through multiple setup steps. Simply run docker-compose watch, and everything will be set up for you.

Akash1000x avatar Apr 18 '24 10:04 Akash1000x

@Akash1000x yeah i can see that but Iam already working on that feature and im waiting for @hkirat to review as he suggested some changes please go through #111

fasal26 avatar Apr 18 '24 10:04 fasal26

@Akash1000x or @fasal26 , Did you'll try optimising dockerfile by copying package.json , yarn.lock ? like this: COPY package.json yarn.lock ./ RUN yarn install COPY . . (continues..)

An unexpected error occurred: "https://registry.yarnpkg.com/@repo%2feslint-config: Not found". 3.335 info If you think this is a bug, please open a bug report with the information provided in "/src/app/yarn-error.log". 3.335 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. ------ Are you'll facing this issue?

dishak avatar May 08 '24 08:05 dishak

@dishak if you want to optimize the Dockerfile you have to copy all the package.json file first then yarn install like this -> COPY package.json ./ COPY yarn.lock ./ COPY apps/web/package.json ./apps/web/ COPY packages/db/package.json ./packages/db/ COPY packages/store/package.json ./packages/store/ COPY packages/eslint-config/package.json ./packages/eslint-config/ COPY packages/typescript-config/package.json ./packages/typescript-config/ COPY packages/common/package.json ./packages/common/ COPY packages/ui/package.json ./packages/ui/

whene i work on it this work for me. you have to ensure all the package.json file are copied

Akash1000x avatar May 08 '24 09:05 Akash1000x

@Akash1000x , Thank you..

dishak avatar May 09 '24 20:05 dishak

/bounty $40

hkirat avatar May 12 '24 19:05 hkirat

@Akash1000x , In docker-compose file the following snippet :

develop: watch: - action: sync path: ./ target: /usr/src/app ignore: - node_modules/ - action: rebuild path: package.json

PLEASE CLARIFY: as per this snippet it rebuilds only the package.json file present in root folder and not other package.json. Is it not important to rebuild any package.json files within the project?

dishak avatar May 13 '24 20:05 dishak