Puan
0
Çözümler
0
Node.js Mikroservis — Fastify:
Kod:
import Fastify from 'fastify';
const app = Fastify({ logger: true });
app.get('/health', async () => ({ status: 'ok' }));
await app.listen({ port: 3000 });
Dockerfile:
Kod:
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3000
CMD ["node", "src/index.js"]
