forked from maya-a-iuga/Web-App-DevOps-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (27 loc) · 1.14 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
42
# Use an official Python runtime as a parent image.
FROM python:3.8-slim
# Set the working directory in the container
WORKDIR /app
# Copy the application files in the container
COPY . /app/
# Install system dependencies and ODBC driver
RUN apt-get update && apt-get install -y \
unixodbc unixodbc-dev odbcinst odbcinst1debian2 libpq-dev gcc && \
apt-get install -y gnupg && \
apt-get install -y wget && \
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
wget -qO- https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
apt-get update && \
ACCEPT_EULA=Y apt-get install -y msodbcsql18 && \
apt-get purge -y --auto-remove wget && \
apt-get clean
# Install pip and setuptools
RUN pip install --upgrade pip setuptools
# Install Python packages specified in requirements.txt
RUN pip install --trusted-host pypi.python.org -r requirements.txt
# Install Azure Identity and Azure Key Vault libraries
RUN pip install azure-identity azure-keyvault-secrets
# Expose port
EXPOSE 5000
# Define Startup Command
CMD ["python", "app.py"]