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

How to run nginx locally? Looks like upsteam configuration is missing #145

Closed
lilong7676 opened this issue Sep 23, 2022 · 6 comments
Closed
Labels

Comments

@lilong7676
Copy link

$ pnpm run docker:start:nginx
error: nginx: [emerg] host not found in upstream "serverless" in /etc/nginx/nginx.conf:34

@lilong7676 lilong7676 added the bug label Sep 23, 2022
@lilong7676
Copy link
Author

there is another problem,But I have already run redis and mysql locally, the command used is docker compose up -d

➜  lagon git:(main) ✗ pnpm run docker:start:serverless
 WARN  Unsupported engine: wanted: {"node":">=16.0.0"} (current: {"node":"v14.19.3","pnpm":"7.3.0"})

> lagon@0.0.1 docker:start:serverless /Users/lilonglong/Desktop/long_git/lagon
> docker run --rm -p 4000:4000 lagon/serverless


> @lagon/serverless@0.0.4 start /app/packages/serverless
> node dist/index.js

/app/node_modules/.pnpm/@prisma+client@3.15.2_prisma@3.15.2/node_modules/@prisma/client/runtime/index.js:49028
        throw new PrismaClientInitializationError(message, this.client._clientVersion);
              ^

PrismaClientInitializationError: Can't reach database server at `localhost`:`3306`

Please make sure your database server is running at `localhost`:`3306`.
    at RequestHandler.request (/app/node_modules/.pnpm/@prisma+client@3.15.2_prisma@3.15.2/node_modules/@prisma/client/runtime/index.js:49028:15)
    at async PrismaClient._request (/app/node_modules/.pnpm/@prisma+client@3.15.2_prisma@3.15.2/node_modules/@prisma/client/runtime/index.js:49919:18)
    at async master (file:///app/packages/serverless/dist/index.js:896:25) {
  clientVersion: '3.15.2',
  errorCode: undefined
}
 ELIFECYCLE  Command failed with exit code 1.

@QuiiBz
Copy link
Member

QuiiBz commented Sep 23, 2022

When running in production, we use PlanetScale for the database. You might need to set up an external database when running it in Docker.

We're currently on a big refactor of moving from Node.js to Rust for the runtime, serveless and CLI packages. Docker setup hasn't yet been migrated, but the repo should be fully working in the next few days.

@QuiiBz
Copy link
Member

QuiiBz commented Sep 23, 2022

Here's the PR migrating the monorepo to TS + Rust:

@lilong7676
Copy link
Author

Will the JS version be kept or maintained? Because I don't know the Rust language very well

@QuiiBz
Copy link
Member

QuiiBz commented Sep 26, 2022

I keep it for historical purposes, but it will be removed in the future. The Rust runtime is faster, safer, and more performant than the JS runtime so it doesn't make sense to keep both.

@lilong7676
Copy link
Author

I see, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants