Skip to content

Commit

Permalink
GA: Docker and GitHub actions support
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Feb 27, 2024
1 parent 8f6d9f8 commit 5ecef67
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# big-AGI non-code files
/docs/
/dist/
README.md

# Ignore build and log files
Dockerfile
/.dockerignore

# Node build artifacts
/node_modules
/.pnp
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ jobs:
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
build-args: NEXT_PUBLIC_GA4_MEASUREMENT_ID=${{ secrets.GA4_MEASUREMENT_ID }}
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
FROM node:18-alpine AS base
ENV NEXT_TELEMETRY_DISABLED 1


# Dependencies
FROM base AS deps
WORKDIR /app
Expand All @@ -14,10 +15,15 @@ COPY src/server/prisma ./src/server/prisma
ENV NODE_ENV development
RUN npm ci


# Builder
FROM base AS builder
WORKDIR /app

# Optional argument to configure GA4 at build time (see: docs/deploy-analytics.md)
ARG NEXT_PUBLIC_GA4_MEASUREMENT_ID
ENV NEXT_PUBLIC_GA4_MEASUREMENT_ID=${NEXT_PUBLIC_GA4_MEASUREMENT_ID}

# Copy development deps and source
COPY --from=deps /app/node_modules ./node_modules
COPY . .
Expand All @@ -29,6 +35,7 @@ RUN npm run build
# Reduce installed packages to production-only
RUN npm prune --production


# Runner
FROM base AS runner
WORKDIR /app
Expand Down

0 comments on commit 5ecef67

Please sign in to comment.