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

docker compose build fail #113

Closed
sjcotto opened this issue May 15, 2022 · 10 comments · May be fixed by #147
Closed

docker compose build fail #113

sjcotto opened this issue May 15, 2022 · 10 comments · May be fixed by #147

Comments

@sjcotto
Copy link

sjcotto commented May 15, 2022

hi there, was trying to install the docker-compose "as is" without any change but it's giving the following error

@calcom/prisma:build: error: Environment variable not found: DATABASE_URL.
@calcom/prisma:build: --> schema.prisma:6
@calcom/prisma:build: |
@calcom/prisma:build: 5 | provider = "postgresql"
@calcom/prisma:build: 6 | url = env("DATABASE_URL")
@calcom/prisma:build: |
@calcom/prisma:build:
@calcom/prisma:build: Validation Error Count: 1
@calcom/prisma:build:

not sure if the solution will be to add the DATABASE_URL into the ARG of the Dockerfile

anyone can help?

@apitel
Copy link

apitel commented May 16, 2022

I am having the same issue

@kaddour-youcef
Copy link

Anyone found a solution ?

@theRealBithive
Copy link

@kaddour-youcef here is a repo that builds from the non docker files and creates a docker container: https://github.com/speckm/calendso-docker

@SebastiaanVanspauwen
Copy link

Facing the same issue

@krumware
Copy link
Member

If possible, please try the changes in #112.
Prior to building, you can run docker compose up -d database, to make a database available, then use host.docker.internal as the hostname for the DATABASE_URL arg, and that will successfully validate the prisma schemas. Afterwards you can change your database host back to the desired runtime database.

@Th0masDB
Copy link

@kaddour-youcef here is a repo that builds from the non docker files and creates a docker container: https://github.com/speckm/calendso-docker

This doesn't work unfortunately.

@SebastiaanVanspauwen
Copy link

@Th0masDB #112 worked for me

@Th0masDB
Copy link

@Th0masDB #112 worked for me

Unfortuanly for me it doesn't.... It makes the container.... But the container won't run with this error (but I think this is another topic):

/calcom/scripts/start.sh:4

scripts/wait-for-it.sh ${DATABASE_HOST} -- echo "database is up"

             ^^^

SyntaxError: Unexpected token 'for'

    at wrapSafe (internal/modules/cjs/loader.js:1001:16)

    at Module._compile (internal/modules/cjs/loader.js:1049:27)

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)

    at Module.load (internal/modules/cjs/loader.js:950:32)

    at Function.Module._load (internal/modules/cjs/loader.js:790:12)

    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)

    at internal/main/run_main_module.js:17:47

@kaddour-youcef
Copy link

kaddour-youcef commented May 22, 2022

I dont know about the docker it did not work, but you can build it from the repo it worked for me ! I'm just facing a bigger issue here, knowing what is open-source and what is not. it's realy not clear for me and there is no docs to explain that what functionality you can use and ...

Leopere pushed a commit to Leopere/calcom-docker that referenced this issue Aug 1, 2022
- added numerous environment variable changes such as implied defaults that can be overriden.
- skipped out on using git modules and just pull repo into build/launch step.  Adherance to license requires no repackaging and this solves this.
- cleaned up now unnecessary .env file.
- recycled environment section using yaml features.
- writing a few strings to config path to persist data between container starts that focus on cryptography and secrets.
- writing installed commit to the config path in case the end user needs to change the upstream git commit ID to a newer version for detection and automagic upgrades.
- added docker-compose.override.yml pattern to .gitignore to allow users to customize their local dev environment if they use docker-compose.yml
- wrote a dockerfile/container image which allows for uploading the base container to a private or public docker container registry without breaking the license rules.
- left .env ignore in case users wish to continue to use the old method.
- updated README.md to include updated simplified instructions.
- added start.sh script and wait-for-it.sh into the shell $PATH to allow for a potential future of allowing the main executable (node JS app) to run under a limited privilege user while still allowing the init scripts to be executed securely.
- added some input sanitation for certain critical variables.
- by default disabled/commented out the studio service as its not to typically be run to enforce better default deployment practices.  I would like to figure out what specific query to execute via the CLI instead of running a whole container to establish the first user in the end.
- wrote relatively unopinionated docker-compose.yml file to avoid causing problems for people trying to deploy this behind a reverse proxy for potential features such as TLS/HTTPS termination.
- upgraded compose version to latest '3.9' to be sure to enable most modern feature set.

Fixes calcom#87 by providing a working baseline with sober defaults.
Fixes calcom#88 by ensuring consistency across all containers Environment vars.
Fixes calcom#93 by allowing users to mount the application files within their IDE workspace, however, this will never solve for any times you will need to run yarn build steps.
Fixes calcom#99 by no longer using git submodules and just pulling a single commit depth copy of the ORIGIN repository on app bootstrap/first boot.
Fixes calcom#113 by no longer requiring build locally if the community maintainer of the Cal docker repository on GitHub will push this image to the hub.
Fixes calcom#121 by removing dependency on BuildKit this is done by simply deploying the app if its detected to be the first execution of this container be it due to no container persistence or a commit version upgrade from ORIGIN.
Fixes calcom#128 by removing dep on BuildKit
Fixes calcom#123 not replicatable and confirmed to be working in repository shipped state.
Fixes calcom#136 by building app on first launch from user define-able envvars which can be defined in numerous ways.
@varghesevisal
Copy link

This issue even exists today.

Prisma schema loaded from schema.prisma
36.82 @calcom/prisma:post-install: Formatted /app/packages/prisma/schema.prisma in 178ms 🚀
37.18 @calcom/prisma:build: cache bypass, force executing 48912e58258dab66
39.92 @calcom/prisma:build: No DATABASE_URL found, skipping migrations
40.00 @calcom/api:build: cache miss, executing 7fa1bf89949b74e8
43.97 @calcom/api:build: destination does not start with /, http://, or https:// for route {"source":"/api/v2","destination":"undefined/health"}
43.97 @calcom/api:build:
43.97 @calcom/api:build: destination does not start with /, http://, or https:// for route {"source":"/api/v2/health","destination":"undefined/health"}
43.97 @calcom/api:build:
43.97 @calcom/api:build: destination does not start with /, http://, or https:// for route {"source":"/api/v2/docs/:path*","destination":"undefined/docs/:path*"}
43.97 @calcom/api:build:
43.97 @calcom/api:build: destination does not start with /, http://, or https:// for route {"source":"/api/v2/:path*","destination":"undefined/api/v2/:path*"}
43.97 @calcom/api:build:
43.97 @calcom/api:build:
43.97 @calcom/api:build: Error: Invalid rewrites found
44.03 @calcom/api:build: ERROR: command finished with error: command (/app/apps/api/v1) yarn run build exited (1)
44.03 command (/app/apps/api/v1) yarn run build exited (1)
44.03
44.03 Tasks: 2 successful, 3 total
44.03 Cached: 0 cached, 3 total
44.03 Time: 39.812s
44.03 Failed: @calcom/api#build
44.03
44.03 ERROR run failed: command exited (1)

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 a pull request may close this issue.

8 participants