Skip to content

Commit

Permalink
chore(examples): update openai example packages and dockerfiles (#1126)
Browse files Browse the repository at this point in the history
  • Loading branch information
Parker-Stafford authored Nov 19, 2024
1 parent 7a16339 commit 6f38725
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions js/examples/openai/backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
7 changes: 4 additions & 3 deletions js/examples/openai/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@ FROM base AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package*.json ./
RUN npm ci
RUN npm i --quiet

# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . /app/
COPY . .
RUN npm run build

# Production image, copy all the files and run the server
FROM base AS runner
WORKDIR /app
ENV NODE_ENV production
COPY --from=builder /app/dist ./dist
COPY package*.json ./
COPY --from=deps /app/node_modules ./node_modules
COPY package.json ./
RUN npm i --production
EXPOSE 8000
CMD ["node", "--import", "./dist/instrumentation.cjs", "./dist/index.cjs"]
2 changes: 1 addition & 1 deletion js/examples/openai/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"type:check": "tsc --noEmit"
},
"dependencies": {
"@arizeai/openinference-instrumentation-openai": "^0.1.0",
"@arizeai/openinference-instrumentation-openai": "^1.1.0",
"@arizeai/openinference-semantic-conventions": "^0.2.0",
"@opentelemetry/api": "^1.7.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.46.0",
Expand Down
8 changes: 6 additions & 2 deletions js/examples/openai/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ services:
ports:
- "6006:6006"
backend:
build: backend
build:
context: backend
dockerfile: Dockerfile
ports:
- "8000:8000"
environment:
Expand All @@ -19,7 +21,9 @@ services:
timeout: 1s
retries: 5
frontend:
build: frontend
build:
context: frontend
dockerfile: Dockerfile
ports:
- "3000:3000"
depends_on:
Expand Down
1 change: 1 addition & 0 deletions js/examples/openai/frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
4 changes: 2 additions & 2 deletions js/examples/openai/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ FROM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY package.json ./
RUN npm i --quiet

# Rebuild the source code only when needed
FROM base AS builder
Expand Down
2 changes: 1 addition & 1 deletion js/examples/openai/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dependencies": {
"ai": "^3.1.20",
"dotenv": "^16.3.1",
"next": "^14.1.1",
"next": "^15.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sswr": "^2.1.0",
Expand Down

0 comments on commit 6f38725

Please sign in to comment.