diff --git a/Dockerfile b/Dockerfile index 29e89d7..335fc74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/bun.lock b/bun.lock index 8a2c787..74ee434 100644 --- a/bun.lock +++ b/bun.lock @@ -1,5 +1,6 @@ { "lockfileVersion": 1, + "configVersion": 0, "workspaces": { "": { "name": "ts-example", diff --git a/src/commands/silly/megamind.ts b/src/commands/silly/megamind.ts index cfb79fc..49f4ec3 100644 --- a/src/commands/silly/megamind.ts +++ b/src/commands/silly/megamind.ts @@ -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'); diff --git a/src/utils/wordController.ts b/src/utils/wordController.ts index 19dc506..6f65e76 100644 --- a/src/utils/wordController.ts +++ b/src/utils/wordController.ts @@ -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';