-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.intel
62 lines (48 loc) · 1.81 KB
/
Dockerfile.intel
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
61
62
# Use Intel base image
FROM intel/oneapi-basekit
# Set the working directory in the container
WORKDIR /app
# Install Python and system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.11 \
python3-pip \
build-essential \
libssl-dev \
libffi-dev \
libjpeg-dev \
libpng-dev \
libsentencepiece-dev \
curl \
gcc \
g++ \
cmake \
&& rm -rf /var/lib/apt/lists/*
# Set Python 3.11 as default
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
# Upgrade pip and install base packages
RUN pip install --upgrade pip setuptools wheel
# Set PYTHONPATH correctly
ENV PYTHONPATH=/app
# Set environment variables
ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
ENV PYTHONUNBUFFERED=1
# Install Intel Extension for PyTorch
RUN pip install intel-extension-for-pytorch==2.0.110+xpu
# Copy the requirements file into the container
COPY requirements_intel.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements_intel.txt
# Copy the rest of the application code
COPY . .
# Set up the environment and logging
RUN python -m pip install --upgrade pip && \
python -c "from config.env_config import setup_environment; setup_environment()"
RUN python -c "from pathlib import Path; from config.logging_config import setup_logging; setup_logging(Path('flux_pipeline.log'))"
# Expose Gradio application port
EXPOSE 7860
# Healthcheck
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:7860/ || exit 1
# Set the command to run the application
CMD ["python3", "-u", "gui.py", "--host", "0.0.0.0", "--port", "7860", "--share"]