-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
170 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
build | ||
.dockerignore | ||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# NextAuth.js Parameters | ||
NEXTAUTH_URL=http://localhost:3000/ | ||
NEXTAUTH_SECRET=c60f1bcb46db934646424129387359d5 | ||
# Linux: `openssl rand -hex 32` or go to https://generate-secret.vercel.app/32 | ||
|
||
# Providers | ||
ENABLE_CREDENTIALS_PROVIDER=true | ||
ENABLE_EMAIL_PROVIDER=false | ||
ENABLE_GITHUB_PROVIDER=false | ||
ENABLE_GOOGLE_PROVIDER=false | ||
|
||
# Credentials Provider Parameters | ||
CREDENTIALS_APPROVED_USERNAME=jsmith | ||
CREDENTIALS_APPROVED_PASSWORD=localhost@ | ||
|
||
# Email Server Parameters | ||
EMAIL_SERVER_USER=resend | ||
EMAIL_SERVER_PASSWORD= | ||
EMAIL_SERVER_HOST=smtp.resend.com | ||
EMAIL_SERVER_PORT=465 | ||
EMAIL_FROM=no-reply@assistantshub.ai | ||
|
||
# GitHub OAuth Parameters | ||
GITHUB_CLIENT_ID= | ||
GITHUB_CLIENT_SECRET= | ||
|
||
# Google OAuth Parameters | ||
GOOGLE_CLIENT_ID= | ||
GOOGLE_CLIENT_SECRET= | ||
|
||
# AWS Parameters | ||
AWS_S3_BUCKET= | ||
AWS_REGION=us-west-2 | ||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
|
||
# OpenAI API Key for Assistants Hub | ||
OPENAI_API_KEY= | ||
# Google AI Studio API Key for Assistants Hub | ||
GOOGLE_AI_STUDIO_API_KEY= | ||
# Groq Cloud API Key for Assistants Hub | ||
GROQ_CLOUD_API_KEY= | ||
# Anthropic API Key for Assistants Hub | ||
ANTHROPIC_API_KEY= | ||
|
||
|
||
# Environment variables declared in this file are automatically made available to Prisma. | ||
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema | ||
|
||
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB. | ||
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings | ||
POSTGRES_PRISMA_URL="postgresql://.." | ||
BLOB_READ_WRITE_TOKEN="vercel_blob_rw_..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
FROM node:latest as base | ||
|
||
# 1. Install dependencies only when needed | ||
FROM base AS deps | ||
|
||
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. | ||
RUN apt-get update | ||
RUN apt-get install build-essential | ||
RUN apt-get install openssl | ||
|
||
WORKDIR /app | ||
|
||
# 2. Rebuild the source code only when needed | ||
FROM deps AS builder | ||
|
||
WORKDIR /app | ||
|
||
COPY public ./public | ||
COPY src ./src | ||
COPY package.json ./package.json | ||
COPY .prettierrc.json ./.prettierrc.json | ||
COPY next.config.js ./next.config.js | ||
COPY tsconfig.json ./tsconfig.json | ||
COPY tailwind.config.ts ./tailwind.config.ts | ||
|
||
COPY prisma ./prisma | ||
|
||
RUN corepack enable pnpm && pnpm install | ||
|
||
# This will do the trick, use the corresponding env file for each environment. | ||
COPY .env.template .env | ||
RUN npm run build | ||
|
||
# 3. Production image, copy all the files and run next | ||
FROM base AS runner | ||
WORKDIR /app | ||
|
||
ENV NODE_ENV=production | ||
|
||
RUN addgroup --gid 1001 nodejs && adduser -uid 1001 --gid 1001 nextjs | ||
|
||
COPY --from=builder /app/public ./public | ||
COPY --from=builder /app/.env ./.env | ||
|
||
# Automatically leverage output traces to reduce image size | ||
# https://nextjs.org/docs/advanced-features/output-file-tracing | ||
COPY --from=builder --chown=nextjs:nodejs /app/.next/server ./ | ||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static | ||
|
||
USER nextjs | ||
|
||
EXPOSE 3000 | ||
ENV PORT 3000 | ||
|
||
CMD HOSTNAME=localhost node server.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
version: '3.8' | ||
services: | ||
nextjs: | ||
platform: | ||
linux/arm64 | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
image: assistantshub | ||
ports: | ||
- "3000:3000" | ||
volumes: | ||
- .:/app | ||
environment: | ||
- POSTGRES_PRISMA_URL=postgresql://postgres:password@db:5432/assistantshub?schema=public | ||
env_file: | ||
- .env.docker | ||
depends_on: | ||
db: | ||
condition: service_healthy | ||
command: > | ||
sh -c " | ||
npm run generate && | ||
npm run migrate && | ||
npm run seed && | ||
npm run start | ||
" | ||
db: | ||
image: timescale/timescaledb:latest-pg16 | ||
restart: always | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: password | ||
POSTGRES_DB: assistantshub | ||
ports: | ||
- "5432:5432" | ||
volumes: | ||
- pgdata:/var/lib/postgresql/data | ||
healthcheck: | ||
test: [ "CMD-SHELL", "pg_isready -U postgres" ] | ||
interval: 10s | ||
timeout: 8s | ||
retries: 5 | ||
start_period: 10s | ||
|
||
volumes: | ||
pgdata: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters