Dockerfile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. FROM golang:1.13 AS builder
  2. ENV PROTOBUF_VERSION 3.5.1
  3. COPY . /root/src
  4. RUN apt-get update && \
  5. apt-get install -y unzip make && \
  6. curl -SLo protoc.zip https://github.com/google/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-x86_64.zip && \
  7. unzip -d /usr/local protoc.zip && \
  8. rm protoc.zip && \
  9. cd /root/src && \
  10. curl -L "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-$(go env GOOS)-x86_64-1.7.0.tar.gz" | tar -C /usr/local -xz && \
  11. make
  12. FROM ubuntu:18.04
  13. COPY --from=builder /root/src/hercules /usr/local/bin
  14. COPY python /root/src
  15. ENV LC_ALL en_US.UTF-8
  16. RUN apt-get update && \
  17. apt-get upgrade -y && \
  18. apt-get install -y --no-install-suggests --no-install-recommends locales ca-certificates python3 python3-dev python3-distutils libyaml-dev libyaml-0-2 libxml2-dev libxml2 curl git g++ && \
  19. locale-gen en_US.UTF-8 && \
  20. echo '#!/bin/bash\n\
  21. \n\
  22. echo\n\
  23. echo " $@"\n\
  24. echo\n\' > /browser && \
  25. chmod +x /browser && \
  26. curl https://bootstrap.pypa.io/get-pip.py | python3 - pip==18.1 && \
  27. pip3 install --no-cache-dir --no-build-isolation cython && \
  28. sed -i 's/DEFAULT_MATPLOTLIB_BACKEND = None/DEFAULT_MATPLOTLIB_BACKEND = "Agg"/' /root/src/labours/cli.py && \
  29. pip3 install --no-cache-dir /root/src && \
  30. pip3 install --no-cache-dir "tensorflow<2.0" && \
  31. rm -rf /root/src && \
  32. apt-get remove -y python3-dev libyaml-dev libxml2-dev curl git g++ && \
  33. apt-get autoremove -y && \
  34. rm -rf /usr/share/doc /usr/share/man && \
  35. rm -rf /var/lib/apt/lists/* && \
  36. apt-get clean
  37. EXPOSE 8000
  38. ENV BROWSER /browser
  39. ENV COUPLES_SERVER_TIME 7200