Fix: fresh installation is failing

This commit is contained in:
Harshith Mullapudi 2025-07-22 14:35:36 +05:30
parent 8d9ddcf375
commit 0367f111c0
6 changed files with 17 additions and 23 deletions

View File

@ -12,7 +12,7 @@ POSTGRES_PASSWORD=docker
POSTGRES_DB=core POSTGRES_DB=core
LOGIN_ORIGIN=http://localhost:3033 LOGIN_ORIGIN=http://localhost:3033
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?schema=core" DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?schema=core
# This sets the URL used for direct connections to the database and should only be needed in limited circumstances # This sets the URL used for direct connections to the database and should only be needed in limited circumstances
# See: https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#fields:~:text=the%20shadow%20database.-,directUrl,-No # See: https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#fields:~:text=the%20shadow%20database.-,directUrl,-No
@ -56,4 +56,4 @@ MODEL=gpt-4.1-2025-04-14
## Trigger ## ## Trigger ##
TRIGGER_PROJECT_ID= TRIGGER_PROJECT_ID=
TRIGGER_SECRET_KEY= TRIGGER_SECRET_KEY=
TRIGGER_API_URL= TRIGGER_API_URL=http://localhost:8030

View File

@ -6,7 +6,8 @@ import * as path from "path";
import { type MCPTool } from "./types"; import { type MCPTool } from "./types";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"; import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
import { prisma } from "~/db.server"; import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
export const configureStdioMCPEnvironment = ( export const configureStdioMCPEnvironment = (
spec: any, spec: any,

View File

@ -6,7 +6,7 @@ import {
import { prismaExtension } from "@trigger.dev/build/extensions/prisma"; import { prismaExtension } from "@trigger.dev/build/extensions/prisma";
export default defineConfig({ export default defineConfig({
project: "proj_jqsgldpqilpdnvpzyzll", project: process.env.TRIGGER_PROJECT_ID as string,
runtime: "node", runtime: "node",
logLevel: "log", logLevel: "log",
// The max compute seconds a task is allowed to run. If the task run exceeds this duration, it will be stopped. // The max compute seconds a task is allowed to run. If the task run exceeds this duration, it will be stopped.

View File

@ -40,7 +40,7 @@ services:
postgres: postgres:
container_name: core-postgres container_name: core-postgres
image: redplanethq/postgres:0.1.2 image: postgres:15
environment: environment:
- POSTGRES_USER=${POSTGRES_USER} - POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}

View File

@ -37,9 +37,6 @@ export async function initCommand() {
const rootDir = process.cwd(); const rootDir = process.cwd();
const triggerDir = path.join(rootDir, "trigger"); const triggerDir = path.join(rootDir, "trigger");
const webappDir = path.join(rootDir, "apps", "webapp");
const databaseDir = path.join(rootDir, "packages", "database");
const typesDir = path.join(rootDir, "packages", "types");
try { try {
// Step 2: Setup .env file in root // Step 2: Setup .env file in root
@ -231,7 +228,7 @@ export async function initCommand() {
// Step 13: Handle Docker login // Step 13: Handle Docker login
note("Run the following command to login to Docker registry:", "🐳 Docker Registry Login"); note("Run the following command to login to Docker registry:", "🐳 Docker Registry Login");
await handleDockerLogin(triggerEnvPath); await handleDockerLogin(rootDir, triggerEnvPath);
// Step 14: Deploy Trigger.dev tasks // Step 14: Deploy Trigger.dev tasks
await deployTriggerTasks(rootDir); await deployTriggerTasks(rootDir);

View File

@ -1,9 +1,10 @@
import { confirm, log } from "@clack/prompts"; import { log } from "@clack/prompts";
import path from "path"; import path from "path";
import os from "os"; import os from "os";
import fs from "fs"; import fs from "fs";
import { executeCommandInteractive } from "./docker-interactive.js";
export async function handleDockerLogin(triggerEnvPath: string): Promise<void> { export async function handleDockerLogin(rootDir: string, triggerEnvPath: string): Promise<void> {
// Check if Docker is already logged in to localhost:5000 // Check if Docker is already logged in to localhost:5000
let dockerLoginNeeded = true; let dockerLoginNeeded = true;
try { try {
@ -41,8 +42,13 @@ export async function handleDockerLogin(triggerEnvPath: string): Promise<void> {
const dockerRegistryUsername = getEnvValue("DOCKER_REGISTRY_USERNAME"); const dockerRegistryUsername = getEnvValue("DOCKER_REGISTRY_USERNAME");
const dockerRegistryPassword = getEnvValue("DOCKER_REGISTRY_PASSWORD"); const dockerRegistryPassword = getEnvValue("DOCKER_REGISTRY_PASSWORD");
log.info( await executeCommandInteractive(
`docker login -u ${dockerRegistryUsername} -p ${dockerRegistryPassword} ${dockerRegistryUrl} ` `docker login -u ${dockerRegistryUsername} -p ${dockerRegistryPassword} ${dockerRegistryUrl}`,
{
cwd: rootDir,
message: "Logging in to docker...",
showOutput: true,
}
); );
} catch (error) { } catch (error) {
log.info("docker login -u <USERNAME> -p <PASSWORD> <REGISTRY_URL>"); log.info("docker login -u <USERNAME> -p <PASSWORD> <REGISTRY_URL>");
@ -50,14 +56,4 @@ export async function handleDockerLogin(triggerEnvPath: string): Promise<void> {
} else { } else {
log.info("✅ Docker is already logged in to localhost:5000, skipping login prompt."); log.info("✅ Docker is already logged in to localhost:5000, skipping login prompt.");
} }
const dockerLoginConfirmed = await confirm({
message: "Have you completed the Docker login successfully?",
});
if (!dockerLoginConfirmed) {
throw new Error(
"Docker login required. Please complete Docker login first and run the command again."
);
}
} }