diff --git a/src/emailservice/Dockerfile b/src/emailservice/Dockerfile index 8395949..5a1bb22 100644 --- a/src/emailservice/Dockerfile +++ b/src/emailservice/Dockerfile @@ -1,27 +1,45 @@ +FROM python:3-alpine as base +FROM base as builder -# Use the grpc.io provided Python image as the base image -FROM grpc/python:1.0 +# gRPC and app deps +RUN apk add --update --no-cache \ + gcc \ + linux-headers \ + make \ + musl-dev \ + python-dev \ + g++ \ + # App Deps + cairo-dev \ + cairo \ + openssl-dev \ + gobject-introspection-dev -# download the grpc health probe +# get packages +COPY requirements.txt . +RUN pip install -r requirements.txt + +FROM base as final + +# Enable unbuffered logging +ENV PYTHONUNBUFFERED=1 + +# Download the grpc health probe RUN GRPC_HEALTH_PROBE_VERSION=v0.1.0-alpha.1 && \ wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ chmod +x /bin/grpc_health_probe -# show python logs as they occur -ENV PYTHONUNBUFFERED=0 - -# install pip for python3 -RUN apt-get -qqy update && \ - apt-get -qqy install python3-pip - -# get packages WORKDIR /email_server -COPY requirements.txt . -RUN pip3 install -r requirements.txt + +# Grab packages from builder +COPY --from=builder /usr/local/lib/python3.7/ /usr/local/lib/python3.7/ + +# Need libstdc++ for grpc +RUN apk add --no-cache libstdc++ # Add the application COPY . . EXPOSE 8080 -ENTRYPOINT [ "python3", "email_server.py" ] +ENTRYPOINT [ "python", "email_server.py" ] \ No newline at end of file diff --git a/src/emailservice/requirements.txt b/src/emailservice/requirements.txt index de1567e..ca3f1c3 100644 --- a/src/emailservice/requirements.txt +++ b/src/emailservice/requirements.txt @@ -1,31 +1,41 @@ +asn1crypto==0.24.0 cachetools==2.1.0 -certifi==2018.4.16 +certifi==2018.8.24 +cffi==1.11.5 chardet==3.0.4 -cryptography==1.7.1 -google-api-core==1.2.1 -google-auth==1.5.0 +configparser==3.5.0 +cryptography==2.3.1 +entrypoints==0.2.3 +enum34==1.1.6 +futures==3.1.1 +google-api-core==1.4.0 +google-auth==1.5.1 google-cloud-core==0.28.1 google-cloud-trace==0.19.0 googleapis-common-protos==1.5.3 grpc-google-iam-v1==0.11.4 grpcio==1.12.1 -grpcio-health-checking==1.14.1 +grpcio-health-checking==1.12.1 grpcio-tools==1.12.1 idna==2.7 +ipaddress==1.0.22 +jeepney==0.4 Jinja2==2.10 -keyring==10.1 -keyrings.alt==1.3 +keyring==15.1.0 +keyrings.alt==3.1 MarkupSafe==1.0 -opencensus==0.1.5 -protobuf==3.6.0 -pyasn1==0.4.3 +opencensus==0.1.7 +protobuf==3.6.1 +pyasn1==0.4.4 pyasn1-modules==0.2.2 +pycairo==1.17.1 +pycparser==2.19 pycrypto==2.6.1 -pygobject==3.22.0 +PyGObject==3.30.1 pytz==2018.5 -pyxdg==0.25 +pyxdg==0.26 requests==2.19.1 -rsa==3.4.2 -SecretStorage==2.3.1 +rsa==4.0 +SecretStorage==3.1.0 six==1.11.0 -urllib3==1.23 +urllib3==1.23 \ No newline at end of file