updated emailservice Dockerfile
This commit is contained in:
parent
626b8d0f41
commit
ebb2547093
3 changed files with 30 additions and 28 deletions
|
@ -1,45 +1,48 @@
|
|||
FROM debian:stretch as base
|
||||
ENV d = 1
|
||||
FROM python:3-alpine as base
|
||||
|
||||
FROM base as builder
|
||||
|
||||
# gRPC and app deps
|
||||
RUN apt-get update
|
||||
|
||||
RUN apt-get install -q -y --no-install-recommends \
|
||||
git cmake curl \
|
||||
python-dev python-setuptools python-pip \
|
||||
build-essential zlib1g-dev libbz2-dev \
|
||||
libreadline-dev libsqlite3-dev wget curl \
|
||||
llvm libncurses5-dev libncursesw5-dev \
|
||||
xz-utils tk-dev libffi-dev \
|
||||
libssl-dev musl-dev libgirepository1.0-dev libcairo-dev
|
||||
|
||||
# Python
|
||||
ENV PYENV_SHA256 df9449f69918c716e688d4216eb4398d2cd6d2dcd0f7e6f56d55d19d74cc57cc
|
||||
RUN curl -L https://github.com/pyenv/pyenv/archive/v1.2.6.tar.gz -o pyenv.tar.gz
|
||||
RUN echo $PYENV_SHA256 pyenv.tar.gz | sha256sum -c
|
||||
RUN tar zxvf pyenv.tar.gz
|
||||
RUN mv pyenv-* pyenv
|
||||
RUN pyenv/plugins/python-build/install.sh
|
||||
RUN python-build 3.7.0 /usr/local/
|
||||
RUN rm /usr/local/bin/python
|
||||
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
|
||||
|
||||
# get packages
|
||||
RUN pip install --upgrade pip
|
||||
COPY requirements.txt .
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
COPY google_python_cloud_debugger-2.9-py3.7-linux-x86_64.egg .
|
||||
RUN easy_install google_python_cloud_debugger-2.9-py3.7-linux-x86_64.egg
|
||||
|
||||
FROM base as final
|
||||
|
||||
# Enable unbuffered logging
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
# Download the grpc health probe
|
||||
RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \
|
||||
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
|
||||
|
||||
# Enable unbuffered logging
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
WORKDIR /email_server
|
||||
|
||||
# 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" ]
|
||||
|
|
Binary file not shown.
|
@ -12,7 +12,6 @@ google-api-core==1.4.0
|
|||
google-auth==1.5.1
|
||||
google-cloud-core==0.28.1
|
||||
google-cloud-trace==0.19.0
|
||||
google-python-cloud-debugger==2.9
|
||||
googleapis-common-protos==1.5.3
|
||||
grpc-google-iam-v1==0.11.4
|
||||
grpcio==1.12.1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue