-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.Dockerfile
More file actions
42 lines (33 loc) · 879 Bytes
/
Copy pathserver.Dockerfile
File metadata and controls
42 lines (33 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM python:3.9-slim
WORKDIR /app
# Install dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
libavdevice-dev \
libavfilter-dev \
libopus-dev \
libvpx-dev \
pkg-config \
libsrtp2-dev \
libopusfile-dev \
curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy only the requirements first to leverage Docker cache
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Create logs directory
RUN mkdir -p /app/logs
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PORT=8000
# Expose port for HTTP and WebSocket
EXPOSE $PORT
# Health check
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
CMD curl -f http://localhost:$PORT/health || exit 1
# Run the application
CMD ["python", "-m", "server.main"]