mirror of
https://github.com/eliasstepanik/core.git
synced 2026-01-11 09:28:40 +00:00
Fix: fresh installation is failing
This commit is contained in:
parent
8d9ddcf375
commit
0367f111c0
@ -12,7 +12,7 @@ POSTGRES_PASSWORD=docker
|
||||
POSTGRES_DB=core
|
||||
|
||||
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
|
||||
# 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_PROJECT_ID=
|
||||
TRIGGER_SECRET_KEY=
|
||||
TRIGGER_API_URL=
|
||||
TRIGGER_API_URL=http://localhost:8030
|
||||
|
||||
@ -6,7 +6,8 @@ import * as path from "path";
|
||||
|
||||
import { type MCPTool } from "./types";
|
||||
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 = (
|
||||
spec: any,
|
||||
|
||||
@ -6,7 +6,7 @@ import {
|
||||
import { prismaExtension } from "@trigger.dev/build/extensions/prisma";
|
||||
|
||||
export default defineConfig({
|
||||
project: "proj_jqsgldpqilpdnvpzyzll",
|
||||
project: process.env.TRIGGER_PROJECT_ID as string,
|
||||
runtime: "node",
|
||||
logLevel: "log",
|
||||
// The max compute seconds a task is allowed to run. If the task run exceeds this duration, it will be stopped.
|
||||
|
||||
@ -40,7 +40,7 @@ services:
|
||||
|
||||
postgres:
|
||||
container_name: core-postgres
|
||||
image: redplanethq/postgres:0.1.2
|
||||
image: postgres:15
|
||||
environment:
|
||||
- POSTGRES_USER=${POSTGRES_USER}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
|
||||
@ -37,9 +37,6 @@ export async function initCommand() {
|
||||
|
||||
const rootDir = process.cwd();
|
||||
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 {
|
||||
// Step 2: Setup .env file in root
|
||||
@ -231,7 +228,7 @@ export async function initCommand() {
|
||||
|
||||
// Step 13: Handle Docker 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
|
||||
await deployTriggerTasks(rootDir);
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import { confirm, log } from "@clack/prompts";
|
||||
import { log } from "@clack/prompts";
|
||||
import path from "path";
|
||||
import os from "os";
|
||||
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
|
||||
let dockerLoginNeeded = true;
|
||||
try {
|
||||
@ -41,8 +42,13 @@ export async function handleDockerLogin(triggerEnvPath: string): Promise<void> {
|
||||
const dockerRegistryUsername = getEnvValue("DOCKER_REGISTRY_USERNAME");
|
||||
const dockerRegistryPassword = getEnvValue("DOCKER_REGISTRY_PASSWORD");
|
||||
|
||||
log.info(
|
||||
`docker login -u ${dockerRegistryUsername} -p ${dockerRegistryPassword} ${dockerRegistryUrl} `
|
||||
await executeCommandInteractive(
|
||||
`docker login -u ${dockerRegistryUsername} -p ${dockerRegistryPassword} ${dockerRegistryUrl}`,
|
||||
{
|
||||
cwd: rootDir,
|
||||
message: "Logging in to docker...",
|
||||
showOutput: true,
|
||||
}
|
||||
);
|
||||
} catch (error) {
|
||||
log.info("docker login -u <USERNAME> -p <PASSWORD> <REGISTRY_URL>");
|
||||
@ -50,14 +56,4 @@ export async function handleDockerLogin(triggerEnvPath: string): Promise<void> {
|
||||
} else {
|
||||
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."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user