41 lines
836 B
Docker
41 lines
836 B
Docker
FROM node:18
|
|
|
|
# Install Python and required dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
python3 \
|
|
python3-pip \
|
|
python3-dev \
|
|
python3-venv \
|
|
build-essential \
|
|
libsndfile1 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy Python requirements and install in virtual environment
|
|
COPY requirements.txt ./
|
|
RUN python3 -m venv /opt/venv
|
|
ENV PATH="/opt/venv/bin:$PATH"
|
|
RUN pip install -r requirements.txt
|
|
|
|
# Copy package files
|
|
COPY package.json yarn.lock* ./
|
|
COPY .yarnrc ./
|
|
|
|
# Install Node.js dependencies
|
|
RUN yarn install --frozen-lockfile
|
|
|
|
# Copy application code
|
|
COPY . .
|
|
|
|
# Make Python script executable
|
|
RUN chmod +x speech_processor.py
|
|
|
|
# Expose port
|
|
EXPOSE 5080
|
|
|
|
# Ensure virtual environment is active for runtime
|
|
ENV PATH="/opt/venv/bin:$PATH"
|
|
|
|
# Start the application
|
|
CMD ["yarn", "start"] |