47 lines
1.1 KiB
Docker
47 lines
1.1 KiB
Docker
# CI Runner Image for EuchreCamp
|
|
# Pre-installed with all dependencies to speed up CI runs
|
|
# This image is rebuilt automatically when package.json changes
|
|
|
|
FROM node:20-alpine
|
|
|
|
# Install system dependencies needed for various tasks
|
|
RUN apk add --no-cache \
|
|
bash \
|
|
git \
|
|
curl \
|
|
python3 \
|
|
make \
|
|
g++ \
|
|
&& rm -rf /var/cache/apk/*
|
|
|
|
# Set working directory
|
|
WORKDIR /workspace
|
|
|
|
# Copy package files first (for better caching)
|
|
COPY package*.json ./
|
|
|
|
# Install ALL dependencies including dev dependencies
|
|
# This is done at image build time, not at CI runtime
|
|
RUN npm ci
|
|
|
|
# Copy Prisma schema (needed for Prisma client generation)
|
|
COPY prisma/schema.prisma ./prisma/
|
|
|
|
# Generate Prisma client
|
|
RUN npx prisma generate
|
|
|
|
# Copy the rest of the application
|
|
COPY . .
|
|
|
|
# Set environment variables for CI environment
|
|
ENV NODE_ENV=production
|
|
ENV DATABASE_PROVIDER=sqlite
|
|
ENV DATABASE_URL=file:./prisma/ci.db
|
|
ENV BETTER_AUTH_SECRET=test-secret-key-for-ci-only
|
|
|
|
# Verify installations
|
|
RUN node --version && npm --version && git --version && npx prisma --version
|
|
|
|
# Default command
|
|
CMD ["/bin/sh"]
|