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

feat: add Docker and Docker Compose support #3417

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
.git
.gitignore
Dockerfile
docker-compose.yml
.env
.env.local
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM node:20.15.1
codewithtyler marked this conversation as resolved.
Show resolved Hide resolved

WORKDIR /app

# Install pnpm (matches packageManager in package.json)
RUN npm install -g [email protected]

# Copy package files first
COPY package.json pnpm-lock.yaml ./

# Clean install dependencies with legacy peer deps
RUN rm -rf node_modules
RUN pnpm install --no-frozen-lockfile
RUN pnpm rebuild
codewithtyler marked this conversation as resolved.
Show resolved Hide resolved

# Copy source code
COPY . .

# Create empty .env.local if it doesn't exist
RUN touch .env.local

# Expose Vite's default port
EXPOSE 5173

# Required for WebContainer API
ENV NODE_ENV=development
ENV VITE_LOG_LEVEL=debug

# Start Vite directly instead of through Remix
CMD ["pnpm", "exec", "vite", "dev", "--host"]
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
services:
bolt:
container_name: bolt
image: bolt-new
build:
context: .
dockerfile: Dockerfile
ports:
- "5173:5173"
volumes:
- .:/app
- /app/node_modules
environment:
- NODE_ENV=development
- VITE_LOG_LEVEL=debug
env_file:
- .env.local
cap_add:
- SYS_ADMIN
security_opt:
- seccomp=unconfined
command: pnpm exec vite dev --host
networks:
- boltnew

networks:
boltnew:
name: boltnew
5 changes: 5 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ export default defineConfig((config) => {
build: {
target: 'esnext',
},
server: {
host: '0.0.0.0',
strictPort: true,
port: 5173,
},
plugins: [
nodePolyfills({
include: ['path', 'buffer'],
Expand Down
Loading