39 lines
1.7 KiB
Docker
39 lines
1.7 KiB
Docker
# Base CI image with Bun, Node.js, Playwright, and build tools
|
|
# Used for Gitea Actions CI workflows
|
|
# Uses Microsoft Playwright image as base (Ubuntu-based) with Bun added
|
|
|
|
FROM mcr.microsoft.com/playwright:v1.59.1-jammy AS base
|
|
|
|
# Install unzip (required for Bun installation) and other tools
|
|
RUN apt-get update && apt-get install -y unzip ca-certificates curl gnupg lsb-release && rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Docker CLI (for building/pushing images in CI)
|
|
RUN install -m 0755 -d /etc/apt/keyrings && \
|
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
|
|
chmod a+r /etc/apt/keyrings/docker.gpg && \
|
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \
|
|
apt-get update && apt-get install -y docker-ce-cli docker-compose-plugin && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Bun (latest version)
|
|
# Note: The playwright image already has Node.js pre-installed
|
|
RUN curl -fsSL https://bun.sh/install | bash
|
|
|
|
# Add Bun to PATH for subsequent commands
|
|
ENV PATH="/root/.bun/bin:$PATH"
|
|
|
|
# Verify installations
|
|
RUN echo "=== Bun Version ===" && bun --version && \
|
|
echo "=== Node.js Version ===" && node --version && \
|
|
echo "=== Playwright Version ===" && bun x playwright --version
|
|
|
|
WORKDIR /app
|
|
|
|
# Set default environment variables
|
|
ENV DATABASE_PROVIDER=postgresql
|
|
ENV BETTER_AUTH_SECRET=test-secret-key-for-ci-only
|
|
ENV NODE_ENV=test
|
|
|
|
# Health check command (can be overridden)
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD bun --version |