-
Notifications
You must be signed in to change notification settings - Fork 168
/
Dockerfile.dev
60 lines (46 loc) · 1.53 KB
/
Dockerfile.dev
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Use Ubuntu 24.04 as base image to match CI environment
FROM ubuntu:24.04
# Prevent interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Set working directory
WORKDIR /app
# Install system dependencies matching CI configuration
RUN apt-get update && \
apt-get install -y \
python3-full \
python3-pip \
python3-venv \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# Create and activate virtual environment
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
# Upgrade pip
RUN python3 -m pip install --upgrade pip
# Install testing and linting dependencies
RUN pip install --no-cache-dir \
flake8 \
pytest \
pytest-xdist
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the package files
COPY . .
# Install the package in editable mode
RUN pip install -e .
# Set environment variables
ENV PYTHONUNBUFFERED=1
# Verify installations
RUN echo "Verifying installations:" && \
echo "Ubuntu version:" && cat /etc/os-release && \
echo "FFmpeg version:" && ffmpeg -version && \
echo "Python version:" && python3 --version && \
echo "Pip version:" && pip --version && \
echo "Installed packages:" && pip list
# Run flake8 checks during build
RUN flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics && \
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# Command to run when container starts
CMD ["python3"]