Dockerise
continuous-integration/drone/push Build is passing Details

pull/6/head^2
Clément FRÉVILLE 5 months ago
parent c0ac68a516
commit 13788c5538

@ -0,0 +1,4 @@
node_modules
Dockerfile
.dockerignore
*.js

@ -0,0 +1,14 @@
FROM node:22-bookworm AS runner
WORKDIR /app
ENV NODE_ENV="production"
COPY package.json package-lock.json ./
RUN npm install --omit=dev
FROM runner AS builder
COPY . .
RUN npm install && npm run build && npm prune --omit=dev
FROM runner
COPY --from=builder /app/dist /app
EXPOSE 3000
ENTRYPOINT ["node", "src/server.js"]

@ -3,11 +3,12 @@
"module": "src/server.ts",
"type": "module",
"scripts": {
"build": "tsc",
"build": "tsc && tsc-alias",
"start": "tsx src/server.ts"
},
"devDependencies": {
"@types/bun": "^1.0.4",
"tsc-alias": "^1.8.10",
"tsx": "^4.7.0",
"typescript": "^5.3.3"
},

@ -5,7 +5,7 @@ import { Type, TypeBoxTypeProvider } from "@fastify/type-provider-typebox";
import websocket, { WebSocket } from "@fastify/websocket";
import Fastify, { FastifyReply } from "fastify";
import { nanoid } from "nanoid";
import { allocateBuffer, getRunner } from "runner";
import { allocateBuffer, getRunner } from "./runner";
import { Pull, Push } from "zeromq";
import * as db from "./database";
@ -559,4 +559,4 @@ async function forwardOutput() {
}
/* Lancer le serveur et la fonction forwardOutput sur le même thread en parallèle */
await Promise.all([fastify.listen({ port: 3000 }), forwardOutput()]);
await Promise.all([fastify.listen({ port: 3000, host: '0.0.0.0' }), forwardOutput()]);

@ -1,15 +1,15 @@
{
"compilerOptions": {
"baseUrl": "./src",
"outDir": "./dist",
"types": ["bun-types"],
"lib": ["esnext"],
"module": "esnext",
"target": "esnext",
"moduleResolution": "bundler",
"noEmit": true,
"allowImportingTsExtensions": true,
"moduleResolution": "Node",
"noEmit": false,
"moduleDetection": "force",
"strict": true,
@ -18,5 +18,8 @@
"composite": true,
"downlevelIteration": true,
"allowSyntheticDefaultImports": true
},
"tsc-alias": {
"resolveFullPaths": true
}
}

Loading…
Cancel
Save