forked from Azure-Samples/contoso-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
27 lines (23 loc) · 1.13 KB
/
Dockerfile
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
# Use a specific version of Python image to ensure consistency across builds
FROM mcr.microsoft.com/devcontainers/python:3.11-bullseye
# Combine system updates, package installations and Python upgrades into a single RUN command to reduce layers
# Also, clean up the apt cache to reduce image size
RUN sudo apt-get update && sudo apt-get install -y \
gcc \
cmake \
pkg-config \
libdbus-1-dev \
libglib2.0-dev \
&& python -m pip install --upgrade pip \
&& sudo apt-get clean \
&& sudo rm -rf /var/lib/apt/lists/*
# Copy requirements.txt and install the Python packages
# Install keyring-related and IPython packages in the same layer to reduce the image size and build time
COPY ./src/api/requirements.txt .
RUN pip install -r requirements.txt \
&& pip install keyrings.alt dbus-python ipython ipykernel mkdocs-material
# Configure the IPython kernel
RUN ipython kernel install --name "python3" --user
# Install daily version of azd for latest changes
# See: https://github.com/Azure/azure-dev/tree/main/cli/installer#download-from-daily-builds
RUN curl -fsSL https://aka.ms/install-azd.sh | bash -s -- --version daily