-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (34 loc) · 1.69 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
37
38
39
40
41
#
# docker build -t kdcllc/tokenflow .
#
# docker build --no-cache -t kdcllc/tokenflow .
#
# docker run -p 6700:8080 -e X_AUTH_TOKEN=169ddeb1-502a-42cf-a222-9dbb8ec2cbf6 -e LOGGING_LEVEL=DEBUG kdcllc/tokenflow
#
# keep the state of the azure cli
# docker run -p 6700:8080 -v tokenflow:/root/.temp/ -e X_AUTH_TOKEN=169ddeb1-502a-42cf-a222-9dbb8ec2cbf6 -e LOGGING_LEVEL=DEBUG kdcllc/tokenflow
#
# docker push kdcllc/tokenflow
# Use the official Python 3.12 image from Docker Hub
FROM python:3.12
# Install necessary packages including lsb-release, then obtain the currently installed distribution and store an Azure CLI version of choice
# https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt#install-specific-version
RUN apt-get update && \
apt-get install -y ca-certificates curl apt-transport-https lsb-release gnupg && \
AZ_DIST=$(lsb_release -cs) && \
AZ_VER=2.61.0 && \
echo $AZ_DIST && echo $AZ_VER && \
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/microsoft.asc.gpg > /dev/null && \
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_DIST main" | tee /etc/apt/sources.list.d/azure-cli.list && \
apt-get update && \
apt-get install -y azure-cli=${AZ_VER}-1~$AZ_DIST
# Set the working directory to /app
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Make port 8080 available to the world outside this container
EXPOSE 8080
# Run the command to start Uvicorn
CMD ["uvicorn", "src.api:app", "--host", "0.0.0.0", "--port", "8080"]