diff --git a/.dockerignore b/.dockerignore index 777e43d..f42174a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,6 @@ node_modules dist *.log +.git .env .cache diff --git a/apps/discord-bot/Dockerfile b/apps/discord-bot/Dockerfile index ef93b8c..c7e1e41 100644 --- a/apps/discord-bot/Dockerfile +++ b/apps/discord-bot/Dockerfile @@ -1,9 +1,5 @@ -FROM alpine AS git-sha -RUN apk add --no-cache git -COPY .git .git -RUN git rev-parse --short HEAD > /commit_sha - FROM node:22-alpine + WORKDIR /app RUN corepack enable && corepack prepare pnpm@10.24.0 --activate @@ -19,6 +15,4 @@ RUN pnpm --filter @lbf-bot/utils run build RUN pnpm --filter @lbf-bot/database run build RUN pnpm --filter @lbf/discord-bot run build -COPY --from=git-sha /commit_sha /commit_sha - -CMD export COMMIT_SHA=$(cat /commit_sha) && exec node apps/discord-bot/dist/index.js +CMD ["node", "apps/discord-bot/dist/index.js"] diff --git a/apps/discord-bot/src/commands/ping.ts b/apps/discord-bot/src/commands/ping.ts index c554288..d6600a8 100644 --- a/apps/discord-bot/src/commands/ping.ts +++ b/apps/discord-bot/src/commands/ping.ts @@ -1,5 +1,4 @@ import { noMention } from "~/discord"; -import { env } from "~/env"; import type { Command } from "./index"; export const pingCommand: Command = { @@ -7,7 +6,7 @@ export const pingCommand: Command = { handler: async (message) => { await message.reply({ options: noMention, - content: `🫵 Pong \`${env.COMMIT_SHA}\``, + content: `🫵 Pong`, }); }, }; diff --git a/apps/discord-bot/src/env.ts b/apps/discord-bot/src/env.ts index 9369330..60362dc 100644 --- a/apps/discord-bot/src/env.ts +++ b/apps/discord-bot/src/env.ts @@ -15,7 +15,6 @@ export const env = parseEnv({ DISCORD_TRACKING_CHANNEL: z.string(), DISCORD_REPORT_CHANNEL: z.string(), DISCORD_STAFF_ROLE_ID: z.string(), - COMMIT_SHA: z.string().default("dev"), WOV_API_KEY: z.string(), WOV_CLAN_ID: z.string(), WOV_FETCH_INTERVAL: z.coerce.number(),