Created
December 1, 2021 14:25
-
-
Save joshatxantie/bdd29cd16796026495426dce3ff2bb43 to your computer and use it in GitHub Desktop.
AWS Lambda Container Image for Python and PYODBC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM public.ecr.aws/lambda/python:3.9 | |
COPY . ${LAMBDA_TASK_ROOT} | |
RUN yum update -y \ | |
&& curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo \ | |
&& yum remove unixODBC-utf16 unixODBC-utf16-devel \ | |
&& ACCEPT_EULA=Y yum install -y msodbcsql17 \ | |
&& ACCEPT_EULA=Y yum install -y mssql-tools \ | |
&& echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc \ | |
&& source ~/.bashrc \ | |
&& yum install -y unixODBC-devel \ | |
&& yum install -y gcc-c++ \ | |
&& yum clean all \ | |
&& pip install --no-cache-dir --upgrade pip setuptools \ | |
&& pip install --no-cache-dir -r requirements.txt --target "${LAMBDA_TASK_ROOT}" | |
CMD [ "main.handler" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment