-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
184e432
commit d20dfe4
Showing
8 changed files
with
72 additions
and
28 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,7 @@ | ||
__pycache__ | ||
*.pyc | ||
*.pyo | ||
*.pyd | ||
.env | ||
.git | ||
.gitignore |
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 |
---|---|---|
@@ -1,23 +1,33 @@ | ||
# Use an official Python runtime as the base image | ||
FROM python:3.9-slim | ||
FROM python:3.9 | ||
|
||
# Set environment variables | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
# Install system dependencies and Rust compiler | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
curl \ | ||
&& curl https://sh.rustup.rs -sSf | sh -s -- -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Add Rust to PATH | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy the requirements file into the container | ||
# Install Python dependencies | ||
COPY requirements.txt . | ||
RUN pip install --upgrade pip && \ | ||
pip install --no-cache-dir -r requirements.txt | ||
|
||
# Install the Python dependencies | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Copy the rest of the backend code into the container | ||
# Copy project files | ||
COPY . . | ||
|
||
# Expose the port that your backend app will run on | ||
EXPOSE 8000 | ||
# Create directory for audio files | ||
RUN mkdir -p /app/audio | ||
|
||
# Command to run the application using uvicorn | ||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] | ||
EXPOSE 8000 | ||
|
||
# Set environment variable (this is a default value, will be overwritten by docker run command) | ||
ENV ELEVENLABS_API_KEY="" | ||
# Run the application | ||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ pydub | |
TTS | ||
ffmpeg-python | ||
elevenlabs | ||
aiofiles | ||
aiofiles | ||
numpy |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules | ||
.next | ||
.git | ||
*.log | ||
# Ensure the following line is NOT present | ||
# public |
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 |
---|---|---|
@@ -1,13 +1,35 @@ | ||
FROM node:14 | ||
# Stage 1: Build | ||
FROM node:18.17.0 AS builder | ||
|
||
WORKDIR /app | ||
|
||
# Install dependencies | ||
COPY package*.json ./ | ||
|
||
RUN npm install | ||
|
||
# Copy source code and build | ||
COPY . . | ||
RUN npm run build | ||
|
||
# Stage 2: Production | ||
FROM node:18.17.0 | ||
|
||
WORKDIR /app | ||
|
||
# Install only production dependencies | ||
COPY package*.json ./ | ||
RUN npm install --only=production | ||
|
||
# Copy built application from builder | ||
COPY --from=builder /app/.next ./.next | ||
COPY --from=builder /app/public ./public | ||
COPY --from=builder /app/next.config.js ./next.config.js | ||
|
||
# Set environment variable for port | ||
ENV PORT=3001 | ||
|
||
# Expose port | ||
EXPOSE 3001 | ||
|
||
CMD ["npm", "run", "dev", "--", "-p", "3001"] | ||
# Start the application | ||
CMD ["npm", "start"] |
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 |
---|---|---|
@@ -1,9 +1,7 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
server: { | ||
port: 3001 | ||
} | ||
// Removed the 'server' key as it's invalid in Next.js configuration | ||
} | ||
|
||
module.exports = nextConfig |