Merge pull request #3 from codewithtyler/feature/docker

Feature/docker
This commit is contained in:
Dustin Loring 2025-01-15 10:04:43 -05:00 committed by GitHub
commit d6525af305
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 70 additions and 0 deletions

7
.dockerignore Normal file
View File

@ -0,0 +1,7 @@
node_modules
.git
.gitignore
Dockerfile
docker-compose.yml
.env
.env.local

30
Dockerfile Normal file
View File

@ -0,0 +1,30 @@
FROM node:20.15.1
WORKDIR /app
# Install pnpm (matches packageManager in package.json)
RUN npm install -g pnpm@9.4.0
# 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
# 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
docker-compose.yml Normal file
View File

@ -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

View File

@ -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'],