init
This commit is contained in:
35
Dockerfile
Normal file
35
Dockerfile
Normal file
@@ -0,0 +1,35 @@
|
||||
FROM python:3.9-slim as base
|
||||
|
||||
# Install dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
python3-pip \
|
||||
ffmpeg \
|
||||
wget \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Python requirements
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Download Vosk model
|
||||
RUN wget https://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip && \
|
||||
unzip vosk-model-small-en-us-0.15.zip && \
|
||||
mv vosk-model-small-en-us-0.15 model && \
|
||||
rm vosk-model-small-en-us-0.15.zip
|
||||
|
||||
# Copy application code
|
||||
COPY app.py .
|
||||
COPY Caddyfile .
|
||||
|
||||
FROM base as production
|
||||
# Install gunicorn and eventlet
|
||||
RUN pip install gunicorn eventlet
|
||||
|
||||
# Expose ports (8000 for app, 2019 for Caddy admin)
|
||||
EXPOSE 8000 2019
|
||||
|
||||
CMD ["caddy", "run", "--config", "/app/Caddyfile"]
|
||||
|
||||
FROM base as development
|
||||
# For development with auto-reload
|
||||
CMD ["python", "app.py"]
|
||||
Reference in New Issue
Block a user