diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..67b91e2 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +node_modules +.git +dist +*.log +.env +.env.* +.vscode diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..927bb3e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +# syntax=docker/dockerfile:1 + +FROM node:22-alpine + +WORKDIR /app + +# Use the Yarn version pinned via package.json "packageManager" / .yarnrc.yml yarnPath +RUN corepack enable + +# Install dependencies first to maximize layer caching. +# devDependencies are required at runtime because the app is executed with tsx. +COPY .yarnrc.yml package.json yarn.lock ./ +COPY .yarn/ ./.yarn/ +RUN yarn install --immutable + +# Copy the rest of the source +COPY . . + +# The bot is a long-running gateway process executed directly from TypeScript via tsx. +# (No build step / no HTTP port.) +CMD ["yarn", "start"] diff --git a/railway.json b/railway.json new file mode 100644 index 0000000..94a9bd3 --- /dev/null +++ b/railway.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://railway.com/railway.schema.json", + "build": { + "builder": "DOCKERFILE", + "dockerfilePath": "Dockerfile" + } +}