Dockerfile 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. FROM python:3 as base
  2. MAINTAINER Ben Yanke <benyanke@gmail.com>
  3. ##############
  4. # Main setup stage
  5. ##############
  6. # Copy in deps first, to improve build caching
  7. COPY requirements.txt /app-src/requirements.txt
  8. WORKDIR /app-src
  9. # Get kerberos deps before pip deps can be fetched
  10. #RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -qq -y krb5-user -y && rm -rf /var/lib/apt/lists/*
  11. # Get latest pip and dependencies
  12. RUN /usr/local/bin/python3 -m pip install --upgrade pip && pip install -r requirements.txt
  13. # Copy in rest of the code after deps are in place
  14. COPY . /app-src
  15. # Install the app
  16. RUN /usr/local/bin/python3 setup.py install
  17. ##############
  18. # Run tests in a throwaway stage
  19. # if tests are added later, run them here
  20. ##############
  21. #FROM base as test
  22. #WORKDIR /app-src
  23. #RUN /usr/local/bin/python3 setup.py test
  24. ##############
  25. # Throw away the test stage, revert back to base stage before push
  26. ##############
  27. FROM base
  28. WORKDIR /root
  29. CMD ["/usr/local/bin/offlineimap"]
  30. # reads from /root/.offlineimaprc by default - mount this in for running