cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

Create a full independent docker environment to run the project on

Open ologbonowiwi opened this issue 1 year ago β€’ 8 comments

Is your proposal related to a problem?

I tried to get one "good first issue" and was kind of annoying to setup a database externally just to start to contribute to the project

Describe the solution you'd like

It would be nice to have a docker-compose.yml setup with everything that we need to run the app, something that with a docker-compose up on the repo's source we'll be able to run the project easily.

ologbonowiwi avatar May 01 '23 01:05 ologbonowiwi

Hey @ologbonowiwi, can you be a bit more specific about what was the issue that you faced? If you follow the setup doc, it is actually a one line command to get things started. There is already a docker-compose file for postgres setup and seeding the database.

antipr000 avatar May 01 '23 04:05 antipr000

So I need to

cd packages/prisma
docker-compose up

And then run the APP with yarn?

ologbonowiwi avatar May 01 '23 16:05 ologbonowiwi

Yes, the app isn't running on docker only the database run's on docker container, the application is not containerized, also you can use yarn dx in the root directory to spin up the container

zeeshanbhati avatar May 01 '23 22:05 zeeshanbhati

/bounty 50

PeerRich avatar May 17 '23 18:05 PeerRich

πŸ’Ž $50 bounty created by PeerRich πŸ‘‰ No need to comment asking to work on it. Just open a PR and claim the bounty with /claim #8591 inside the PR πŸ“ Before proceeding, please make sure you can receive payouts in your country πŸ’΅ Payment arrives in your account 2-5 days after the bounty is rewarded πŸ’― You keep 100% of the bounty award πŸ™ Thank you for contributing to calcom/cal.com!

algora-pbc[bot] avatar May 17 '23 18:05 algora-pbc[bot]

@PeerRich I would like to suggest having a make file or bash file that can execute all the necessary local setup with just one command. Additionally, there is already a repository available that contains a Docker Compose setup for local development. what do you think?

XLAR-8 avatar May 18 '23 22:05 XLAR-8

Hey @ologbonowiwi @PeerRich, can you assign me, I would like to take up this issue.

tcchawla avatar May 19 '23 19:05 tcchawla

Hey @tcchawla, I'm already working on this one, making a docker-compose.yml, but if you want to try another approach, please feel free to do it

ologbonowiwi avatar May 19 '23 19:05 ologbonowiwi

πŸ’‘ @ologbonowiwi submitted a pull request that claims the bounty. You can visit your org dashboard to reward. πŸ‘‰ @ologbonowiwi: To receive payouts, sign up on Algora, link your Github account and connect with Stripe on your dashboard.

algora-pbc[bot] avatar May 21 '23 20:05 algora-pbc[bot]

@PeerRich @zeeshanbhati @antipr000 can you take a look at the PR #9017 that I created?

I needed to delete the db-up from the turbo.json, which I know isn't the best approach, but I had to start from somewhere. It would be nice to have your thoughts on my implementation before we merge to get it 100% working πŸ˜„

ologbonowiwi avatar May 21 '23 20:05 ologbonowiwi

@krumware can review!

PeerRich avatar May 25 '23 18:05 PeerRich

@PeerRich @krumware folks, I created a draft PR with some changes using calcom/docker as a base to build the docker image.

Unfortunately, it's SUPER SLOW on my computer, and I'm still trying to figure out why. It shouldn't matter, but I'm running on Mac M1.

The last logs that I saw are these:

2023-06-09 01:18:48 @calcom/web:dev: wait  - compiling / (client and server)...
2023-06-09 01:19:01 @calcom/web:dev: event - compiled client and server successfully in 13.4s (347 modules)

and it was 10 minutes ago 🀣 I tried for a couple of hours, but I'm not getting anywhere anymore.

Can anyone run the container and see if it's working?

ologbonowiwi avatar Jun 09 '23 04:06 ologbonowiwi

@PeerRich @krumware sorry for the spam, guys, but it looks like it's ready to review πŸ˜„

I was able to fix the issue, clone a brand new repo, run yarn install && yarn dx, and the project started successfully (database, mail service, and web app).

Can anyone take a look? It should be a quick one πŸ˜„

ologbonowiwi avatar Jun 09 '23 05:06 ologbonowiwi

Can we take the conversation over to calcom/docker? most of these tools already exist over there. The PR submitted uses the image generated from cal.com/docker as a base image and doesn't actually generate a new image with the user's source-code, so it might misdirect users to thinking that the dockerfile in this repo is the correct one to use for building their images.

It seems like the devex problem we're experiencing, as well as trying to solve, is how effectively we're directing users to calcom/docker. Another option is to migrate calcom/docker into calcom/cal.com (which we've talked about in the past), to eliminate the submodule workflow and the secondary repo.

@PeerRich thoughts?

p.s. testing final multi-arch updates now

krumware avatar Jun 10 '23 14:06 krumware

Bring calcom/docker here would be the best option. What made me create this issue was the toughness to run the project for the first time, and the need to go over calcom/docker to do it doesn't seem the best option, because it doesn't able new developers to start the project by running one single command

If you see this part of my PR, you'll see that I'm overriding the apps/web and packages using the local source code. Probably the optimal option, in this case, would be to copy the package.json and re-install the dependencies, but this took too long to run here, and I removed it from my implementation (which I can change due to version incompatibility issues that this approach can bring)

ologbonowiwi avatar Jun 10 '23 15:06 ologbonowiwi

@PeerRich @krumware @emrysal guys, I think I found a mid-term that doesn't go against the past decisions on the project and still has the benefits of running the project in one single command. Can anyone review #9995? I appreciate any help you can give me.

ologbonowiwi avatar Jul 07 '23 18:07 ologbonowiwi

@PeerRich @krumware sorry for the spam, guys, but it looks like it's ready to review πŸ˜„

I was able to fix the issue, clone a brand new repo, run yarn install && yarn dx, and the project started successfully (database, mail service, and web app).

Can anyone take a look? It should be a quick one πŸ˜„

I think you are using windows system and forgot to run sym links for prisma env files..

Before I was also facing same issue later ran with admin privileges in gitbash with symlinksπŸ˜ƒ

fancymithun avatar Jul 18 '23 07:07 fancymithun

@fancymithun I'm on Mac M1 actually πŸ‘€ but I open a PR improving the start of the app anyways

ologbonowiwi avatar Jul 18 '23 13:07 ologbonowiwi

/attempt #8591

Options

KSSaiTeja avatar Aug 23 '23 07:08 KSSaiTeja

Note: The user @ologbonowiwi is already attempting to complete issue #8591 and claim the bounty. If you attempt to complete the same issue, there is a chance that @ologbonowiwi will complete the issue first, and be awarded the bounty. We recommend discussing with @ologbonowiwi and potentially collaborating on the same solution versus creating an alternate solution.

algora-pbc[bot] avatar Aug 23 '23 07:08 algora-pbc[bot]

as i am beginner.. i can't work on this issue.. please assign to someone else

KSSaiTeja avatar Aug 23 '23 07:08 KSSaiTeja

It's been four months since I opened the issue. I tried three approaches to solve this, but we merged none.

Would you mind tipping me for my work and closing the issue @PeerRich?

If you still have anything you expect from this issue, I'll happily implement it. But I tried a couple of times now, but none seemed ideal.

ologbonowiwi avatar Aug 23 '23 19:08 ologbonowiwi

@ologbonowiwi Is this issue still open for contribution, if it's the dev environment we want, maybe we can use something like Vagrant, In my case I used yarn dx to create the dev env and it was very straight forward for me.

SauravChanda avatar Aug 30 '23 15:08 SauravChanda