Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: setup docker #122

Merged
merged 7 commits into from
Mar 2, 2024
Merged

Feat: setup docker #122

merged 7 commits into from
Mar 2, 2024

Conversation

devsargam
Copy link
Collaborator

This pr setups:

  • Docker and docker compose with hot reloading
  • Integrates postgres db in the compose
  • Fixes the missed migration

Copy link

vercel bot commented Feb 26, 2024

@devsargam is attempting to deploy a commit to the My Team Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

netlify bot commented Feb 26, 2024

👷 Deploy request for charming-semolina-f274cf pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit dffc74c

@devsargam
Copy link
Collaborator Author

@hkirat LMK, if you want any changes.

@devsargam
Copy link
Collaborator Author

@siinghd could you review this?

@devsargam devsargam changed the title Feat/setup docker Feat:setup docker Feb 26, 2024
@devsargam devsargam changed the title Feat:setup docker Feat: setup docker Feb 26, 2024
Copy link
Contributor

@geekyharsh05 geekyharsh05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devsargam Optimize the Docker builds by adding a .dockerignore file.

@hkirat
Copy link
Contributor

hkirat commented Feb 29, 2024

Can u get rid of the lock file changes?
other than that good to go from my side

@devsargam
Copy link
Collaborator Author

Currently in college will do it when I reach home @hkirat

@siinghd
Copy link
Collaborator

siinghd commented Feb 29, 2024

I think "dev:docker": "DATABASE_URL=postgresql://postgres:postgres@db:5432/cms?schema=public prisma migrate deploy && next dev",

this can be improved, looks bit messy. Just my personal opinion

@devsargam
Copy link
Collaborator Author

@siinghd do u have a workaround for it? I didn't find any other way than this hack

@siinghd
Copy link
Collaborator

siinghd commented Feb 29, 2024

@siinghd do u have a workaround for it? I didn't find any other way than this hack

"scripts": {
  "prisma:migrate": "prisma migrate deploy",
  "dev:docker": "npm run prisma:migrate && next dev"
}

in docker-compose.yml

version: '3.5'
services:
  app:
    environment:
      - DATABASE_URL=postgresql://postgres:postgres@db:5432/cms?schema=public
    build: .
    container_name: cms-docker
    ports:
      - '3000:3000'
    volumes:
      - .:/usr/src/app
      - /usr/src/app/node_modules
    depends_on:
      - db

@devsargam
Copy link
Collaborator Author

@hkirat this is ready for merge you can go on

@devsargam
Copy link
Collaborator Author

Can we use a single package manager as a source of truth in this repo from now on? Since, doing npm i changes the package-lock.json and yarn.lock which are very difficult to change in case of merge conflicts

@hkirat hkirat self-requested a review March 1, 2024 05:29
@hkirat hkirat merged commit 580868e into code100x:main Mar 2, 2024
1 of 2 checks passed
@hkirat
Copy link
Contributor

hkirat commented Mar 2, 2024

/bounty $50
Thankyou

@devsargam devsargam deleted the feat/setup-docker branch March 2, 2024 10:49
@devsargam
Copy link
Collaborator Author

Thanks a lot kirat bhaiya 🙇🏻‍♀️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants