diff --git a/Dockerfile b/Dockerfile index 7402ccd..9d1348f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ -# Build stage -FROM node:22-alpine AS build +FROM node:22-alpine # Install native build tools for bcrypt RUN apk add --no-cache python3 make g++ @@ -11,24 +10,10 @@ RUN npm ci COPY tsconfig.json ./ COPY src ./src - -RUN npm run build - -# Runtime stage -FROM node:22-alpine AS runtime - -RUN apk add --no-cache python3 make g++ - -WORKDIR /app - -COPY package*.json ./ -RUN npm ci --omit=dev - -COPY --from=build /app/dist ./dist COPY public ./public RUN mkdir -p /app/data/uploads EXPOSE 3000 -CMD ["node", "dist/index.js"] +CMD ["node", "--import", "tsx", "src/index.ts"] diff --git a/package.json b/package.json index d4670cb..667d161 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "type": "module", "main": "dist/index.js", "scripts": { - "build": "tsc", + "build": "tsc --noEmit", "dev": "tsx src/index.ts", "test": "vitest run", "test:watch": "vitest", diff --git a/tsconfig.json b/tsconfig.json index 17ac102..168f13f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,18 +1,15 @@ { "compilerOptions": { "target": "ES2022", - "module": "ESNext", - "moduleResolution": "Bundler", - "outDir": "dist", - "rootDir": "src", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "allowImportingTsExtensions": true, + "noEmit": true, "strict": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, - "declaration": true, - "declarationMap": true, - "sourceMap": true + "resolveJsonModule": true }, "include": ["src/**/*"], "exclude": ["node_modules", "dist", "tests"]