-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (27 loc) · 1.37 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
28
29
30
31
32
33
34
35
36
# Use the official Azure Functions Python base image
FROM mcr.microsoft.com/azure-functions/python:4-python3.11
# Install ffmpeg and other required dependencies
RUN apt-get update && apt-get install -y ffmpeg curl tesseract-ocr
# # Install Azure Functions Core Tools (for running func command)
# RUN curl -sL https://aka.ms/func-install | bash
# RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
# RUN mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
# # Fix the malformed entry in the dotnetdev.list file
# RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list
# Update the package list
# RUN apt-get update
RUN apt-get update && apt-get install -y azure-functions-core-tools-4
# Set the working directory
WORKDIR /home/site/wwwroot
# Copy the function app code into the container
COPY . /home/site/wwwroot
# Install Python dependencies
RUN pip install --no-cache-dir -r /home/site/wwwroot/requirements.txt
# Set environment variables for Azure Functions
ENV FUNCTIONS_WORKER_RUNTIME=python
ENV AzureWebJobsScriptRoot=/home/site/wwwroot
ENV AzureFunctionsJobHost__Logging__Console__IsEnabled=true
# Expose port 80
EXPOSE 80
# Command to run the Azure Functions runtime using func
CMD ["func", "host", "start", "--port", "80"]