Update Dockerfile
Browse files- Dockerfile +20 -29
Dockerfile
CHANGED
|
@@ -1,43 +1,34 @@
|
|
| 1 |
-
# Use the
|
| 2 |
-
FROM
|
| 3 |
|
| 4 |
-
# Install system dependencies
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
&& apt-get clean
|
| 13 |
|
| 14 |
-
# Set up PulseAudio configuration
|
| 15 |
-
RUN mkdir -p /etc/pulse
|
| 16 |
-
RUN echo "default-server = unix:/tmp/pulseaudio.socket" > /etc/pulse/client.conf
|
| 17 |
-
RUN echo "autospawn = no" >> /etc/pulse/client.conf
|
| 18 |
-
RUN echo "daemon-binary = /bin/true" >> /etc/pulse/client.conf
|
| 19 |
-
RUN echo "enable-shm = false" >> /etc/pulse/client.conf
|
| 20 |
-
|
| 21 |
-
# Create a PulseAudio socket
|
| 22 |
-
RUN mkdir -p /tmp/pulse
|
| 23 |
-
RUN chmod 777 /tmp/pulse
|
| 24 |
-
|
| 25 |
-
# Start PulseAudio in the background
|
| 26 |
-
RUN pulseaudio -D --exit-idle-time=-1
|
| 27 |
-
|
| 28 |
-
# Create a virtual microphone
|
| 29 |
-
RUN pactl load-module module-null-sink sink_name=virtual_mic
|
| 30 |
-
RUN pactl load-module module-virtual-source source_name=virtual_mic.monitor
|
| 31 |
-
|
| 32 |
# Set the working directory inside the container
|
| 33 |
WORKDIR /app
|
| 34 |
|
| 35 |
-
# Copy
|
| 36 |
-
COPY .
|
| 37 |
|
| 38 |
# Install Python dependencies
|
| 39 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 40 |
|
|
|
|
|
|
|
|
|
|
| 41 |
# Expose the Streamlit default port
|
| 42 |
EXPOSE 8501
|
| 43 |
|
|
|
|
| 1 |
+
# Use the official Python image as the base image
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
|
| 4 |
+
# Install system dependencies
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
+
libopus0 \
|
| 7 |
+
libgstreamer1.0-0 \
|
| 8 |
+
gstreamer1.0-plugins-base \
|
| 9 |
+
gstreamer1.0-plugins-good \
|
| 10 |
+
gstreamer1.0-plugins-bad \
|
| 11 |
+
gstreamer1.0-plugins-ugly \
|
| 12 |
+
gstreamer1.0-libav \
|
| 13 |
+
gstreamer1.0-doc \
|
| 14 |
+
gstreamer1.0-tools \
|
| 15 |
+
libgstreamer-plugins-base1.0-dev \
|
| 16 |
+
libssl-dev \
|
| 17 |
+
libffi-dev \
|
| 18 |
&& apt-get clean
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
# Set the working directory inside the container
|
| 21 |
WORKDIR /app
|
| 22 |
|
| 23 |
+
# Copy the requirements file into the container
|
| 24 |
+
COPY requirements.txt .
|
| 25 |
|
| 26 |
# Install Python dependencies
|
| 27 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 28 |
|
| 29 |
+
# Copy the rest of the application code into the container
|
| 30 |
+
COPY . .
|
| 31 |
+
|
| 32 |
# Expose the Streamlit default port
|
| 33 |
EXPOSE 8501
|
| 34 |
|