Files
no-twitter-bot-stats/Dockerfile
Lucid 1485c27fe5
Some checks failed
Main / build-and-push-docker-image (20.x) (push) Failing after 4m36s
fix copy
2025-12-06 15:39:09 -05:00

34 lines
826 B
Docker

# --- Stage 1: Dependencies ---
FROM node:20-alpine AS dependencies
RUN corepack enable
RUN corepack prepare yarn@stable --activate
WORKDIR /app
COPY package.json yarn.lock .yarnrc.yml ./
RUN yarn install
# --- Stage 2: Builder ---
FROM node:20-alpine AS builder
ARG DATABASE_URL
ENV DATABASE_URL=${DATABASE_URL}
RUN corepack enable
RUN corepack prepare yarn@stable --activate
WORKDIR /app
COPY --from=dependencies /app/node_modules ./node_modules
COPY . ./
RUN yarn prisma-gen
RUN yarn build
# --- Stage 3: Runner ---
FROM node:20-alpine AS runner
ARG DATABASE_URL
ENV DATABASE_URL=${DATABASE_URL}
RUN corepack enable
RUN corepack prepare yarn@stable --activate
WORKDIR /app
COPY --from=builder /app/build ./build
COPY --from=builder /app/.yarn ./.yarn
EXPOSE 3000
CMD ["yarn", "start"] # Replace with your start command