Files
no-twitter-bot/Dockerfile
Lucid Kobold 5acc0c367f dockerfile
2025-06-20 16:40:46 -04:00

41 lines
618 B
Docker

FROM node:lts-slim AS base
# Enable Corepack
RUN corepack enable
# Set Yarn to the latest stable version
RUN yarn set version stable
# Create app directory
WORKDIR /usr/src
FROM base AS builder
# Files required by npm install
COPY package*.json ./
# Install app dependencies
RUN yarn install
# Bundle app source
COPY . .
# Type check app
RUN yarn typecheck
FROM base AS runner
# Files required by npm install
COPY package*.json ./
# Install only production app dependencies
RUN yarn install
# Bundle app source
COPY . .
USER node
# Start the app
EXPOSE 80
CMD ["node", "--import", "tsx", "./src/main.ts"]