Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/api/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ REDIS_PORT=
REDIS_DOCKER_PORT=6397

OPENAI_API_KEY="sk-your api key"
GPT_MODEL="gpt-4o"
GPT_MODEL="gpt-4o"

# Docker env
COMPOSE_PROJECT_NAME=transcript-summarizer-api
29 changes: 29 additions & 0 deletions apps/api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Use Node.js 20 as the base image
FROM node:20

# Set the working directory inside the container
WORKDIR /app

# Copy package.json and package-lock.json to the container
COPY package*.json ./

# Set NODE_ENV environment variable
ENV NODE_ENV production

# Running `npm ci` removes the existing node_modules directory and passing in --only=production ensures that only the production dependencies are installed. This ensures that the node_modules directory is as optimized as possible
RUN npm ci --only=production && npm cache clean --force

# Install Nest CLI globally
RUN npm install -g @nestjs/cli

# Copy the rest of the application code to the container
COPY . .

# Build the NestJS application
RUN npm run build

# Expose the port your application will run on
EXPOSE 3000

# Command to start your NestJS application
CMD ["node", "dist/main.js"]
2 changes: 1 addition & 1 deletion apps/api/Transcript Summarization.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"formdata": [
{
"key": "operations",
"value": "{\"query\":\"mutation ($file: Upload!) {\\n createSummary(createSummaryInput: { inputFile: $file }) {\\n id\\n }\\n}\"}",
"value": "{\"query\":\"mutation ($file: Upload!) {\\n createSummary(createSummaryInput: { inputFile: $file }) {\\n jobId\\n }\\n}\"}",
"type": "text"
},
{
Expand Down
39 changes: 39 additions & 0 deletions apps/api/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: '3'
services:
transcript-summarizer-api:
image: transcript-summarizer-api
container_name: transcript-summarizer-api
build:
context: .
dockerfile: Dockerfile
ports:
- '127.0.0.1:${SERVER_PORT}:3000'
depends_on:
- transcript-summarizer-mariadb
- transcript-summarizer-redis
environment:
NODE_ENV: production

transcript-summarizer-mariadb:
container_name: transcript-summarizer-mariadb
image: mariadb:latest
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_USER: ${DB_USERNAME}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_DATABASE: ${DB_NAME}
ports:
- '127.0.0.1:${MARIADB_DOCKER_PORT}:3306'
volumes:
- transcript-summarizer-mariadb-data:/var/lib/mysql

transcript-summarizer-redis:
container_name: transcript-summarizer-redis
image: redis:latest
restart: always
ports:
- '127.0.0.1:${REDIS_DOCKER_PORT}:6379'

volumes:
transcript-summarizer-mariadb-data: ~
1 change: 0 additions & 1 deletion apps/api/src/config/typeorm/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default new DataSource({
password: configService.getOrThrow<string>('DB_PASSWORD'),
database: configService.getOrThrow<string>('DB_NAME'),
entities: [],
autoLoadEntities: true,
migrations: ['src/database/migrations/**'],
migrationsTableName: 'summary_migrations',
synchronize: false,
Expand Down