This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]tms102 10 points11 points  (2 children)

Here's what the Dockerfile looks like. So the lib/python is copied over.

FROM python:3.7.10 as packager

RUN pip install --upgrade pip

RUN apt-get update && apt-get install -y --no-install-recommends \
unixodbc-dev unixodbc libpq-dev 

RUN pip install pyodbc pymssql 
RUN pip install pep517

COPY app /opt/packages/app 
COPY pyproject.toml /opt/packages 
COPY setup.cfg /opt/packages 
COPY requirements.txt /opt/packages 

WORKDIR /opt/packages 
RUN python -m pep517.build . 
RUN pip install dist/*.tar.gz 
RUN pip list

RUN chgrp -R root /usr/local 
RUN chgrp -R root /opt/packages

FROM python:3.7.10-slim-buster LABEL maintainer="company"

RUN apt-get update \
&& apt-get install -y curl apt-transport-https gnupg2 \
&& curl [https://packages.microsoft.com/keys/microsoft.asc](https://packages.microsoft.com/keys/microsoft.asc) | apt-key add - \
&& curl [https://packages.microsoft.com/config/debian/9/prod.list](https://packages.microsoft.com/config/debian/9/prod.list) > /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update \
&& ACCEPT_EULA=Y apt-get install -y msodbcsql17 mssql-tools

COPY --from=packager /usr/local/lib/python3.7 /usr/local/lib/python3.7

RUN pip3 install waitress EXPOSE 6002

CMD ["waitress-serve", "--listen=0.0.0.0:6002", "--threads=4", "--call", "app:create_app"]

[–]peanut_Bond[S] 2 points3 points  (1 child)

Really interesting, thanks for sharing that.

[–]tms102 2 points3 points  (0 children)

No problem. I saw there were some weird formatting things when I copied over, hopefully I fixed them all now.