feat: ready to deploy

This commit is contained in:
2026-04-01 23:34:22 +02:00
parent 6af2de8380
commit 14c849225c
4 changed files with 30 additions and 22 deletions

View File

@@ -1,31 +1,35 @@
FROM node:lts
# Build stage
FROM node:lts-alpine AS build
FROM oven/bun:alpine AS base
WORKDIR /app
RUN apk add --no-cache --virtual .gyp python3 make g++
# Install dependencies
FROM base AS deps
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile
# Build the application
FROM base AS build
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN corepack enable yarn
RUN yarn
RUN yarn build
# Final stage
FROM node:lts-alpine AS final
RUN bun prisma generate
RUN bun run build
# Production image
FROM base AS runner
WORKDIR /app
COPY --from=build /app/dist ./dist
COPY --from=build /app/src ./src
COPY --from=build /app/.sern ./.sern
COPY --from=build /app/assets ./assets
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/package.json ./package.json
RUN apk add --no-cache ffmpeg msttcorefonts-installer fontconfig && \
ENV NODE_ENV=production
# Install system dependencies
RUN apk add --no-cache ffmpeg fontconfig ttf-opensans msttcorefonts-installer && \
update-ms-fonts && \
fc-cache -f
CMD ["node", "dist/index.js"]
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
COPY --from=build /app/assets ./assets
COPY --from=build /app/images ./images
COPY --from=build /app/.sern ./.sern
COPY --from=build /app/package.json ./package.json
COPY --from=build /app/prisma ./prisma
CMD ["bun", "dist/index.js"]

View File

@@ -1,5 +1,6 @@
{
"lockfileVersion": 1,
"configVersion": 0,
"workspaces": {
"": {
"name": "ts-example",

View File

@@ -35,6 +35,9 @@ export default commandModule({
ctxCanvas.fillStyle = 'white';
ctxCanvas.textAlign = 'center';
ctxCanvas.textBaseline = 'middle';
ctxCanvas.strokeStyle = 'black';
ctxCanvas.lineWidth = 4;
ctxCanvas.strokeText(texto, canvas.width / 2, canvas.height - 510);
ctxCanvas.fillText(texto, canvas.width / 2, canvas.height - 510);
const encode = await canvas.encode('png');

View File

@@ -100,7 +100,7 @@ export class WordController extends EventEmitter {
const startX = 250 - (wordLength * 20);
const baseY = 450;
this.canvasCtx.font = '20px Arial';
this.canvasCtx.font = '20px "Open Sans", Verdana';
this.canvasCtx.textAlign = 'center';
this.canvasCtx.fillStyle = '#cdd6f4';
this.canvasCtx.strokeStyle = '#cdd6f4';