ci: add CI image builder workflow and Dockerfile

This commit is contained in:
2026-03-31 22:11:20 -07:00
parent e303955599
commit adf20693c5
2 changed files with 128 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
# 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 /app
# 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"]