# # Stage 1: Generate documentation with full project
# FROM google/cloud-sdk:stable AS docs-builder

# # Set working directory
# WORKDIR /usr/app/dbt

# # Install dbt BigQuery
# RUN apt-get update && \
#     apt-get install -y python3-pip && \
#     pip3 install dbt-bigquery==1.9.0

# # Copy the entire project for docs generation
# COPY . .

# # Generate docs on prod target
# RUN dbt docs generate --empty-catalog --target prod

# Stage 2: Runtime image with minimal files
FROM ghcr.io/dbt-labs/dbt-bigquery:1.9.latest

# Set working directory
WORKDIR /usr/app/dbt

# Copy only the essential files from builder stage
COPY target ./target
COPY dbt_project.yml ./dbt_project.yml
COPY profiles.yml ./profiles.yml

# Expose port for dbt docs serve
EXPOSE 8080

# Run docs serve directly
CMD ["docs", "serve", "--host", "0.0.0.0", "--port", "8080"]