Skip to content

Instantly share code, notes, and snippets.

@mvoitko
Created July 20, 2019 11:37
Show Gist options
  • Save mvoitko/7854eefa37309cc2fc512f12ee69ec09 to your computer and use it in GitHub Desktop.
Save mvoitko/7854eefa37309cc2fc512f12ee69ec09 to your computer and use it in GitHub Desktop.
Docker image based on Alpine with Tensorflow
FROM python:3.6-alpine
ARG ENV
WORKDIR /app
RUN pip install -U pip
RUN pip install awscli
RUN mkdir train && \
aws s3 cp s3://{bucket}/{model_file}.model train/{model_file}.model
FROM tensorflow/tensorflow:latest-py3
WORKDIR /app
COPY pyproject.toml /app/pyproject.toml
COPY pyproject.lock /app/pyproject.lock
RUN pip3 install -U pip
RUN pip3 install poetry==1.0.0a2 \
&& poetry config settings.virtualenvs.create false
RUN poetry install
# Make sure Tensorflow built properly
RUN python3 -c 'import tensorflow'
COPY --from=0 /app/train /app/app/train
COPY . /app
COPY bin/docker_entrypoint.sh /app/entrypoint.sh
EXPOSE 80
ENTRYPOINT ["/app/entrypoint.sh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment