-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
27 lines (21 loc) · 908 Bytes
/
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
FROM python:3.8-slim AS compile
# Install build tools
RUN apt-get update
RUN apt-get install -y --no-install-recommends build-essential gcc
# Create Python virtual environment
RUN python -m venv /.venv
ENV PATH="/.venv/bin:$PATH"
# Install required Python packages in virtual environment
COPY requirements.txt /
RUN python -m pip install --upgrade pip
RUN pip install -r /requirements.txt
# To enable ssh & remote debugging on app service change the base image to the one below
# FROM mcr.microsoft.com/azure-functions/python:3.0-python3.8-appservice AS build
FROM mcr.microsoft.com/azure-functions/python:3.0-python3.8 AS build
# Get virtual environment from compile stage
COPY --from=compile /.venv /.venv
ENV PATH="/.venv/bin:$PATH"
# Copy and setup Azure Function
COPY . /home/site/wwwroot
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
AzureFunctionsJobHost__Logging__Console__IsEnabled=true