CursorLens icon indicating copy to clipboard operation
CursorLens copied to clipboard

fix compose docker build

Open bitdeep opened this issue 1 year ago • 5 comments

  • fix ENV vars on build.
  • add cursorlens- to prefix intances.
  • use local dir for volume to avoid losing volume on prunes.
  • re-add missing ngrok

bitdeep avatar Aug 25 '24 15:08 bitdeep

Oh I just see this, I'll try it out and merge 🥳

HamedMP avatar Aug 25 '24 21:08 HamedMP

Hi @bitdeep, thanks for the PR, looks great!

I'm running the docker file and even though the ngrok is set, I can't see the URL to set inside Cursor. Also, the NGROK_AUTHTOKEN is required to use ngrok, let's add that to the .env.example file too.

Any idea how to get the URL of the ngrok?

2024-11-02 13:54:16 cursorlens        | Environment variables loaded from .env
2024-11-02 13:54:16 cursorlens        | Prisma schema loaded from prisma/schema.prisma
2024-11-02 13:49:16 cursorlens-db     | The files belonging to this database system will be owned by user "postgres".
2024-11-02 13:49:16 cursorlens-db     | This user must also own the server process.
2024-11-02 13:49:16 cursorlens-db     | 
2024-11-02 13:49:16 cursorlens-db     | The database cluster will be initialized with locale "en_US.utf8".
2024-11-02 13:49:16 cursorlens-db     | The default database encoding has accordingly been set to "UTF8".
2024-11-02 13:54:16 cursorlens        | Datasource "db": PostgreSQL database "postgres", schema "public" at "cursorlens-db:5432"
2024-11-02 13:49:16 cursorlens-db     | The default text search configuration will be set to "english".
2024-11-02 13:54:16 cursorlens        | 
2024-11-02 13:54:16 cursorlens        | 7 migrations found in prisma/migrations
2024-11-02 13:54:16 cursorlens        | 
2024-11-02 13:54:16 cursorlens        | 
2024-11-02 13:54:16 cursorlens        | No pending migrations to apply.
2024-11-02 13:54:17 cursorlens        | Environment variables loaded from .env
2024-11-02 13:54:17 cursorlens        | Running seed command `tsx prisma/seed.ts` ...
2024-11-02 13:54:18 cursorlens        | Seed data inserted successfully
2024-11-02 13:54:18 cursorlens        | 
2024-11-02 13:54:18 cursorlens        | 🌱  The seed command has been executed.
2024-11-02 13:54:18 cursorlens        | ┌─────────────────────────────────────────────────────────┐
2024-11-02 13:54:18 cursorlens        | │  Update available 5.18.0 -> 5.21.1                      │
2024-11-02 13:54:18 cursorlens        | │  Run the following to update                            │
2024-11-02 13:54:18 cursorlens        | │    npm i --save-dev prisma@latest                       │
2024-11-02 13:54:18 cursorlens        | │    npm i @prisma/client@latest                          │
2024-11-02 13:54:18 cursorlens        | └─────────────────────────────────────────────────────────┘
2024-11-02 13:54:18 cursorlens        | 
2024-11-02 13:54:18 cursorlens        | > [email protected] start /app
2024-11-02 13:54:18 cursorlens        | > next start
2024-11-02 13:54:18 cursorlens        | 
2024-11-02 13:49:16 cursorlens-db     | 
2024-11-02 13:54:18 cursorlens        |   ▲ Next.js 14.2.5
2024-11-02 13:54:18 cursorlens        |   - Local:        http://localhost:3000
2024-11-02 13:54:18 cursorlens        | 
2024-11-02 13:54:18 cursorlens        |  ✓ Starting...
2024-11-02 13:54:18 cursorlens        |  ✓ Ready in 340ms
2024-11-02 13:49:16 cursorlens-db     | Data page checksums are disabled.
2024-11-02 13:49:16 cursorlens-db     | 
2024-11-02 13:49:16 cursorlens-db     | fixing permissions on existing directory /var/lib/postgresql/data ... ok
2024-11-02 13:49:16 cursorlens-db     | creating subdirectories ... ok
2024-11-02 13:49:16 cursorlens-db     | selecting dynamic shared memory implementation ... posix
2024-11-02 13:49:16 cursorlens-db     | selecting default max_connections ... 100
2024-11-02 13:49:17 cursorlens-db     | selecting default shared_buffers ... 128MB
2024-11-02 13:49:17 cursorlens-db     | selecting default time zone ... Etc/UTC
2024-11-02 13:49:17 cursorlens-db     | creating configuration files ... ok
2024-11-02 13:49:17 cursorlens-db     | running bootstrap script ... ok
2024-11-02 13:49:18 cursorlens-db     | performing post-bootstrap initialization ... ok
2024-11-02 13:49:19 cursorlens-db     | syncing data to disk ... ok
2024-11-02 13:49:19 cursorlens-db     | initdb: warning: enabling "trust" authentication for local connections
2024-11-02 13:49:19 cursorlens-db     | You can change this by editing pg_hba.conf or using the option -A, or
2024-11-02 13:49:19 cursorlens-db     | --auth-local and --auth-host, the next time you run initdb.
2024-11-02 13:49:19 cursorlens-db     | 
2024-11-02 13:49:19 cursorlens-db     | 
2024-11-02 13:49:19 cursorlens-db     | Success. You can now start the database server using:
2024-11-02 13:49:19 cursorlens-db     | 
2024-11-02 13:49:19 cursorlens-db     |     pg_ctl -D /var/lib/postgresql/data -l logfile start
2024-11-02 13:49:19 cursorlens-db     | 
2024-11-02 13:49:19 cursorlens-db     | waiting for server to start....2024-11-02 12:49:19.345 UTC [47] LOG:  starting PostgreSQL 14.13 (Debian 14.13-1.pgdg120+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-11-02 13:49:19 cursorlens-db     | 2024-11-02 12:49:19.347 UTC [47] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-11-02 13:49:19 cursorlens-db     | 2024-11-02 12:49:19.353 UTC [48] LOG:  database system was shut down at 2024-11-02 12:49:18 UTC
2024-11-02 13:49:19 cursorlens-db     | 2024-11-02 12:49:19.358 UTC [47] LOG:  database system is ready to accept connections
2024-11-02 13:49:19 cursorlens-db     |  done
2024-11-02 13:49:19 cursorlens-db     | server started
2024-11-02 13:49:19 cursorlens-db     | 
2024-11-02 13:49:19 cursorlens-db     | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
2024-11-02 13:49:19 cursorlens-db     | 
2024-11-02 13:49:19 cursorlens-db     | waiting for server to shut down...2024-11-02 12:49:19.511 UTC [47] LOG:  received fast shutdown request
2024-11-02 13:49:19 cursorlens-db     | .2024-11-02 12:49:19.511 UTC [47] LOG:  aborting any active transactions
2024-11-02 13:49:19 cursorlens-db     | 2024-11-02 12:49:19.516 UTC [47] LOG:  background worker "logical replication launcher" (PID 54) exited with exit code 1
2024-11-02 13:49:19 cursorlens-db     | 2024-11-02 12:49:19.516 UTC [49] LOG:  shutting down
2024-11-02 13:49:19 cursorlens-db     | 2024-11-02 12:49:19.526 UTC [47] LOG:  database system is shut down
2024-11-02 13:49:19 cursorlens-db     |  done
2024-11-02 13:49:19 cursorlens-db     | server stopped
2024-11-02 13:49:19 cursorlens-db     | 
2024-11-02 13:49:19 cursorlens-db     | PostgreSQL init process complete; ready for start up.
2024-11-02 13:49:19 cursorlens-db     | 
2024-11-02 13:49:19 cursorlens-db     | 2024-11-02 12:49:19.630 UTC [1] LOG:  starting PostgreSQL 14.13 (Debian 14.13-1.pgdg120+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-11-02 13:49:19 cursorlens-db     | 2024-11-02 12:49:19.630 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-11-02 13:49:19 cursorlens-db     | 2024-11-02 12:49:19.630 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-11-02 13:49:19 cursorlens-db     | 2024-11-02 12:49:19.633 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-11-02 13:49:19 cursorlens-db     | 2024-11-02 12:49:19.638 UTC [60] LOG:  database system was shut down at 2024-11-02 12:49:19 UTC
2024-11-02 13:49:19 cursorlens-db     | 2024-11-02 12:49:19.644 UTC [1] LOG:  database system is ready to accept connections
2024-11-02 13:49:20 cursorlens-db     | 2024-11-02 12:49:20.534 UTC [67] ERROR:  relation "public.ModelCost" does not exist at character 13
2024-11-02 13:49:20 cursorlens-db     | 2024-11-02 12:49:20.534 UTC [67] STATEMENT:  INSERT INTO "public"."ModelCost" ("id","provider","model","inputTokenCost","outputTokenCost","validFrom") VALUES ($1,$2,$3,$4,$5,$6) ON CONFLICT ("provider","model","validFrom") DO UPDATE SET "inputTokenCost" = $7, "outputTokenCost" = $8 WHERE (("public"."ModelCost"."provider" = $9 AND "public"."ModelCost"."model" = $10 AND "public"."ModelCost"."validFrom" = $11) AND 1=1) RETURNING "public"."ModelCost"."id", "public"."ModelCost"."provider", "public"."ModelCost"."model", "public"."ModelCost"."inputTokenCost", "public"."ModelCost"."outputTokenCost", "public"."ModelCost"."validFrom", "public"."ModelCost"."validTo"
2024-11-02 13:54:00 cursorlens-db     | 2024-11-02 12:54:00.876 UTC [1] LOG:  received fast shutdown request
2024-11-02 13:54:00 cursorlens-db     | 2024-11-02 12:54:00.877 UTC [1] LOG:  aborting any active transactions
2024-11-02 13:54:00 cursorlens-db     | 2024-11-02 12:54:00.884 UTC [1] LOG:  background worker "logical replication launcher" (PID 66) exited with exit code 1
2024-11-02 13:54:00 cursorlens-db     | 2024-11-02 12:54:00.884 UTC [61] LOG:  shutting down
2024-11-02 13:54:00 cursorlens-db     | 2024-11-02 12:54:00.927 UTC [1] LOG:  database system is shut down
2024-11-02 13:54:15 cursorlens-db     | 
2024-11-02 13:54:15 cursorlens-db     | PostgreSQL Database directory appears to contain a database; Skipping initialization
2024-11-02 13:54:15 cursorlens-db     | 
2024-11-02 13:54:15 cursorlens-db     | 2024-11-02 12:54:15.763 UTC [1] LOG:  starting PostgreSQL 14.13 (Debian 14.13-1.pgdg120+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-11-02 13:54:15 cursorlens-db     | 2024-11-02 12:54:15.763 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-11-02 13:54:15 cursorlens-db     | 2024-11-02 12:54:15.764 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-11-02 13:54:15 cursorlens-db     | 2024-11-02 12:54:15.765 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-11-02 13:54:15 cursorlens-db     | 2024-11-02 12:54:15.770 UTC [27] LOG:  database system was shut down at 2024-11-02 12:54:00 UTC
2024-11-02 13:54:15 cursorlens-db     | 2024-11-02 12:54:15.776 UTC [1] LOG:  database system is ready to accept connections
2024-11-02 13:54:16 cursorlens-db     | 2024-11-02 12:54:16.536 UTC [34] LOG:  could not receive data from client: Connection reset by peer

HamedMP avatar Nov 02 '24 13:11 HamedMP

Any luck getting this merged, some nice changes here, hoping for more activity. I have some updated my local copy with some local ollama improvements/bug fixes

ckonkel avatar Feb 19 '25 06:02 ckonkel

hi @bitdeep , thanks for the pr and the updates, i really appreciate it.

i will test it against 0.46, i have been told by Cursor that now openai endpoint won't need online connection anymore, if that works, then we can run it fully offline. i'll report back

HamedMP avatar Feb 25 '25 10:02 HamedMP

I have been playing with the docker compose file...

I am exploring the Ollama provider, and am finding that from within docker, it cannot find 127.0.0.1:11434 for ollama.

case "ollama": {
      const ollamaClient = createOllama({
        baseURL: "http://0.0.0.0:11434",
      });
      return ollamaClient.languageModel(model);
    }

I think this might help?

khill-fbmc avatar Mar 31 '25 11:03 khill-fbmc