Private
Public Access
1
0

Fix Docker build: add native deps for bcrypt, simplify vite config

- Add python3/make/g++ to Alpine for bcrypt native compilation
- Remove Socket.IO vite plugin (uses SvelteKit aliases unavailable at config level)
- Use prisma db push instead of migrate deploy for initial setup

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Catherine Renelle
2026-02-25 21:05:45 -05:00
parent 2f398711c8
commit 2c0583d0e4
2 changed files with 7 additions and 18 deletions
+6 -1
View File
@@ -1,6 +1,8 @@
# Stage 1: Build
FROM node:22-alpine AS builder
RUN apk add --no-cache python3 make g++
WORKDIR /app
COPY package.json package-lock.json ./
@@ -15,6 +17,8 @@ RUN npm run build
# Stage 2: Production
FROM node:22-alpine
RUN apk add --no-cache python3 make g++
WORKDIR /app
COPY package.json package-lock.json ./
@@ -26,8 +30,9 @@ RUN npx prisma generate
COPY --from=builder /app/build ./build
COPY --from=builder /app/server.js ./server.js
RUN apk del python3 make g++ && rm -rf /var/cache/apk/*
RUN mkdir -p /app/uploads
EXPOSE 3000
CMD ["sh", "-c", "npx prisma migrate deploy && node server.js"]
CMD ["sh", "-c", "npx prisma db push --skip-generate && node server.js"]
+1 -17
View File
@@ -1,23 +1,7 @@
import { sveltekit } from '@sveltejs/kit/vite';
import tailwindcss from '@tailwindcss/vite';
import { defineConfig } from 'vite';
import type { Plugin } from 'vite';
function socketIOPlugin(): Plugin {
return {
name: 'socket-io-dev',
configureServer(server) {
if (!server.httpServer) return;
// Dynamic import to avoid bundling socket.io in client
import('./src/socket/index.js').then(({ initSocketIO }) => {
initSocketIO(server.httpServer!);
console.log('Socket.IO dev server initialized');
});
}
};
}
export default defineConfig({
plugins: [tailwindcss(), sveltekit(), socketIOPlugin()]
plugins: [tailwindcss(), sveltekit()]
});