diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..e857bf3 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +node_modules +dist +.git +.agent +.antigravity +uploads +*.pdf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..640477c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM node:20-slim +WORKDIR /app +COPY package*.json ./ +RUN npm install +COPY . . +RUN npm run build:client +ENV PORT=3000 +EXPOSE 3000 +CMD ["npx", "tsx", "src/server/index.ts"] diff --git a/src/server/app.ts b/src/server/app.ts index f6a0d59..6ba0d42 100644 --- a/src/server/app.ts +++ b/src/server/app.ts @@ -75,7 +75,7 @@ app.get('/health', (req, res) => { const clientPath = path.join(process.cwd(), 'dist', 'client'); if (fs.existsSync(clientPath)) { app.use(express.static(clientPath)); - app.get('*', (req, res) => { + app.get('/*', (req, res) => { if (!req.path.startsWith('/api') && !req.path.startsWith('/uploads')) { res.sendFile(path.join(clientPath, 'index.html')); }