Create Dockerfile
Browse files- Dockerfile +32 -0
Dockerfile
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.10-slim
|
2 |
+
|
3 |
+
# Create and switch to a non-root user
|
4 |
+
RUN useradd -m -u 1000 user
|
5 |
+
USER user
|
6 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
7 |
+
|
8 |
+
# Set working directory
|
9 |
+
WORKDIR /app
|
10 |
+
|
11 |
+
# Install system dependencies
|
12 |
+
RUN apt-get update && apt-get install -y \
|
13 |
+
libasound2-dev \
|
14 |
+
portaudio19-dev \
|
15 |
+
cmake g++ libpulse-dev \
|
16 |
+
&& rm -rf /var/lib/apt/lists/*
|
17 |
+
|
18 |
+
# Install Python dependencies
|
19 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
20 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
21 |
+
|
22 |
+
# Clone and build ggwave
|
23 |
+
RUN git clone https://github.com/ggerganov/ggwave.git --recursive && \
|
24 |
+
cd ggwave/bindings/python && \
|
25 |
+
make build && \
|
26 |
+
pip install .
|
27 |
+
|
28 |
+
# Copy application files
|
29 |
+
COPY --chown=user . /app
|
30 |
+
|
31 |
+
# Run the application
|
32 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|