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

Open in a devcontainer? #20

Closed
sumith opened this issue Oct 21, 2024 · 3 comments
Closed

Open in a devcontainer? #20

sumith opened this issue Oct 21, 2024 · 3 comments

Comments

@sumith
Copy link

sumith commented Oct 21, 2024

Is your feature request related to a problem? Please describe:

I would like to run this in a docker container to get the obvious benefits of containers.

Describe the solution you'd like:

Add a .devcontainer and include the Dockerfile, docker-compose.yml to run Node.js, pnpm and to have the correct ports open to access Bolt from the host machine.

Describe alternatives you've considered:

Additional context:

I've tried adding the Dockerfile and docker-compose.yml. However, getting stuck with pnpm run preview or pnpm run start. Apparently it can't find the ./bindings.sh file! Running `pnpm run dev --host' option does start. However, accessing it via the regular Chrome receives the message to use Canary. However, the page never opens in Canary!

@80Builder80
Copy link

A Docker container would be greatly appreciated.

I have been beating my head against a wall trying to get a container on my local server. I feel like I'm so close. Took me forever to be able to get it up and running enough to semi-load the page correctly on my network. But I can't seem to get passed this error.

Headers.set: ":method" is an invalid header name.

at webidl.errors.exception (node:internal/deps/undici/undici:1716:14)
at webidl.errors.invalidArgument (node:internal/deps/undici/undici:1727:28)
at _Headers.set (node:internal/deps/undici/undici:3347:31)
at fromNodeHeaders (/app/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]_typ_qwyxqdhnwp3srgtibfrlais3ge/node_modules/@remix-run/dev/dist/vite/node-adapter.js:30:17)
at Object.fromNodeRequest (/app/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]_typ_qwyxqdhnwp3srgtibfrlais3ge/node_modules/@remix-run/dev/dist/vite/node-adapter.js:45:14)
at /app/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]_typ_qwyxqdhnwp3srgtibfrlais3ge/node_modules/@remix-run/dev/dist/vite/cloudflare-proxy-plugin.js:65:37
at process.processTicksAndRejections (node:internal/process/task_queues:95:5

Click outside, press Esc key, or fix the code to dismiss.
You can also disable this overlay by setting server.hmr.overlay to false in vite.config.ts.

I've set the overlay to false with no effect. I tried using a couple of different LLM's to sort out the issue with no luck. Cloudflare seemed to come up several times. But Cloudflare is so baked into Bolt. And I can't get passed the fact that if Bolt works outside a container, it should work inside a container.

Here's what I have so far.

Dockerfile:

// Base image
FROM node:20.15.1

// Install required dependencies
RUN apt-get update &&
apt-get install -y wget gnupg git --no-install-recommends &&
rm -rf /var/lib/apt/lists/*

// Set working directory
WORKDIR /app

Install pnpm (v9.4.0)
RUN npm install -g [email protected]

// Install dependencies using pnpm
COPY . .
RUN pnpm install

// Copy SSL certificates into the image
COPY server.key server.cert /app/

// Expose port
EXPOSE 5173

// Start the development server
CMD ["pnpm", "run", "dev"]

docker-compose.yml:

services:
bolt-new:
build: .
ports:
- "5173:5173"
environment:
- NODE_ENV=development
volumes:
- ./:/app
command: ["pnpm", "run", "dev"]
working_dir: /app
stdin_open: true
tty: true

Modified vite.config.ts:

import { cloudflareDevProxyVitePlugin as remixCloudflareDevProxy, vitePlugin as>
import UnoCSS from 'unocss/vite';
import { defineConfig, type ViteDevServer } from 'vite';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import { optimizeCssModules } from 'vite-plugin-optimize-css-modules';
import tsconfigPaths from 'vite-tsconfig-paths';
import fs from 'fs';
import path from 'path';

export default defineConfig((config) => {
return {
server: {
host: '0.0.0.0', // Bind to all network interfaces
port: 5173, // Explicitly set the port
https: {
key: fs.readFileSync(path.resolve(__dirname, 'server.key')),
cert: fs.readFileSync(path.resolve(__dirname, 'server.cert')),
},
strictPort: true, // Ensure the port is not changed automatically
hmr: {
overlay: false,
},
},
build: {
target: 'esnext',
},
plugins: [

@HomeDev68
Copy link

Probably this might be solved if everything about the WebContainer was done offline.

@hillct
Copy link

hillct commented Oct 26, 2024

This issue is addressed by PR #71

jhillbht pushed a commit to jhillbht/bolt.new-any-llm that referenced this issue Jan 27, 2025
…eading-ollama-section

Updated README Headings and Ollama Section
jhillbht pushed a commit to jhillbht/bolt.new-any-llm that referenced this issue Jan 27, 2025
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

No branches or pull requests

5 participants