├── .github └── workflows │ ├── cassandra.yaml │ └── main.yml ├── 3.9 └── webapp │ ├── cassandra-selenium │ └── Dockerfile │ ├── cassandra │ └── Dockerfile │ ├── chromedriver │ └── Dockerfile │ ├── jupyter-tensorflow │ └── Dockerfile │ ├── selenium │ └── Dockerfile │ └── slim │ └── Dockerfile └── README.md /.github/workflows/cassandra.yaml: -------------------------------------------------------------------------------- 1 | name: Cassandra Docker Image Builder 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | workflow_dispatch: 9 | 10 | jobs: 11 | docker: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout 15 | uses: actions/checkout@v2 16 | - name: Set up QEMU 17 | uses: docker/setup-qemu-action@v1 18 | - name: Set up Docker Buildx 19 | uses: docker/setup-buildx-action@v1 20 | - name: Login to DockerHub 21 | uses: docker/login-action@v1 22 | with: 23 | username: ${{ secrets.DOCKERHUB_USERNAME }} 24 | password: ${{ secrets.DOCKERHUB_TOKEN }} 25 | - name: Build and push Python 3.9 Webapp with Cassandra Driver 26 | id: docker_build_cassandra 27 | uses: docker/build-push-action@v2 28 | with: 29 | push: true 30 | context: ./3.9/webapp/cassandra/ 31 | tags: codingforentrepreneurs/python:3.9-webapp-cassandra 32 | - name: Build and push Python 3.9 Webapp with Cassandra, Chromedriver & Selenium 33 | id: docker_build_cassandra_selenium 34 | uses: docker/build-push-action@v2 35 | with: 36 | push: true 37 | context: ./3.9/webapp/cassandra-selenium/ 38 | tags: codingforentrepreneurs/python:3.9-webapp-cassandra-selenium 39 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Build Container Images 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | workflow_dispatch: 9 | 10 | jobs: 11 | docker: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout 15 | uses: actions/checkout@v2 16 | - name: Set up QEMU 17 | uses: docker/setup-qemu-action@v1 18 | - name: Set up Docker Buildx 19 | uses: docker/setup-buildx-action@v1 20 | - name: Login to DockerHub 21 | uses: docker/login-action@v1 22 | with: 23 | username: ${{ secrets.DOCKERHUB_USERNAME }} 24 | password: ${{ secrets.DOCKERHUB_TOKEN }} 25 | - name: Build and Push Python 3.9 Webapp Slim 26 | id: docker_build_slim 27 | uses: docker/build-push-action@v2 28 | with: 29 | push: true 30 | context: ./3.9/webapp/slim/ 31 | tags: codingforentrepreneurs/python:3.9-webapp-slim 32 | - name: Build and push Python 3.9 Webapp with Chromedriver 33 | id: docker_build_chromedriver 34 | uses: docker/build-push-action@v2 35 | with: 36 | push: true 37 | context: ./3.9/webapp/chromedriver/ 38 | tags: codingforentrepreneurs/python:3.9-webapp-chromedriver 39 | - name: Build and push Python 3.9 Webapp with Chromedriver & Selenium 40 | id: docker_build_selenium 41 | uses: docker/build-push-action@v2 42 | with: 43 | push: true 44 | context: ./3.9/webapp/selenium/ 45 | tags: codingforentrepreneurs/python:3.9-webapp-selenium 46 | - name: Build & Push Python 3.9 Webapp with Jupyter & Tensorflow 47 | id: docker_build_jupyter_tensorflow 48 | uses: docker/build-push-action@v2 49 | with: 50 | push: true 51 | context: ./3.9/webapp/jupyter-tensorflow/ 52 | tags: codingforentrepreneurs/python:3.9-jupyter-tensorflow 53 | -------------------------------------------------------------------------------- /3.9/webapp/cassandra-selenium/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.9-slim 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y \ 5 | build-essential \ 6 | python3-dev \ 7 | python3-setuptools \ 8 | git \ 9 | git-crypt \ 10 | unzip \ 11 | chromium-driver \ 12 | gcc \ 13 | make 14 | 15 | RUN python -m pip install selenium cassandra-driver 16 | 17 | # Create a virtual environment in /opt 18 | RUN python3 -m venv /opt/venv && /opt/venv/bin/python -m pip install selenium cassandra-driver 19 | 20 | RUN apt-get autoremove -y \ 21 | && rm -rf /var/lib/apt/lists/* 22 | -------------------------------------------------------------------------------- /3.9/webapp/cassandra/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.9-slim 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y \ 5 | build-essential \ 6 | python3-dev \ 7 | python3-setuptools \ 8 | git \ 9 | git-crypt \ 10 | unzip \ 11 | chromium-driver \ 12 | gcc \ 13 | make 14 | 15 | RUN python -m pip install cassandra-driver 16 | 17 | RUN apt-get autoremove -y \ 18 | && rm -rf /var/lib/apt/lists/* 19 | -------------------------------------------------------------------------------- /3.9/webapp/chromedriver/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.9-slim 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y \ 5 | build-essential \ 6 | python3-dev \ 7 | python3-setuptools \ 8 | git \ 9 | git-crypt \ 10 | unzip \ 11 | chromium-driver \ 12 | gcc \ 13 | make 14 | 15 | # Create a virtual environment in /opt 16 | RUN python3 -m venv /opt/venv 17 | 18 | RUN apt-get autoremove -y \ 19 | && rm -rf /var/lib/apt/lists/* 20 | -------------------------------------------------------------------------------- /3.9/webapp/jupyter-tensorflow/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.9-slim 2 | 3 | # Update and install defaults 4 | RUN apt-get update && \ 5 | apt-get install -y \ 6 | build-essential \ 7 | python3-dev \ 8 | python3-setuptools \ 9 | gcc \ 10 | make 11 | 12 | 13 | # Install python deps globally 14 | RUN python3 -m pip install scikit-learn numpy pandas tensorflow jupyter 15 | 16 | # Create a virtual environment in /opt 17 | RUN python3 -m venv /opt/venv --system-site-packages 18 | 19 | # Autoremove unecessary files 20 | RUN apt-get autoremove -y \ 21 | && rm -rf /var/lib/apt/lists/* 22 | -------------------------------------------------------------------------------- /3.9/webapp/selenium/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.9-slim 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y \ 5 | build-essential \ 6 | python3-dev \ 7 | python3-setuptools \ 8 | git \ 9 | git-crypt \ 10 | unzip \ 11 | chromium-driver \ 12 | gcc \ 13 | make 14 | 15 | RUN python -m pip install selenium 16 | 17 | # Create a virtual environment in /opt 18 | RUN python3 -m venv /opt/venv && /opt/venv/bin/python -m pip install selenium 19 | 20 | RUN apt-get autoremove -y \ 21 | && rm -rf /var/lib/apt/lists/* 22 | -------------------------------------------------------------------------------- /3.9/webapp/slim/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.9-slim 2 | 3 | # Update and install defaults 4 | RUN apt-get update && \ 5 | apt-get install -y \ 6 | build-essential \ 7 | python3-dev \ 8 | python3-setuptools \ 9 | gcc \ 10 | make 11 | 12 | # Create a virtual environment in /opt 13 | RUN python3 -m venv /opt/venv 14 | 15 | # Autoremove unecessary files 16 | RUN apt-get autoremove -y \ 17 | && rm -rf /var/lib/apt/lists/* 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker Python 2 | Dockerfiles for various python configurations. View this on Dockerhub at [codingforentrepreneurs/python](https://hub.docker.com/repository/docker/codingforentrepreneurs/python). 3 | 4 | 5 | 6 | 7 | ## Using our pre-built images: 8 | Our long term goal is to have images that make it more effecient to bootup a docker-based python application. See ways to improve? Please submit a pull request. 9 | 10 | 11 | 12 | ### Python 3.9 Webapp wuth Selenium & Chromedriver 13 | 14 | ```Dockerfile 15 | FROM codingforentrepreneurs/python:3.9-webapp-selenium 16 | ``` 17 | 18 | ### Python 3.9 Webapp with Chromedriver (no selenium) 19 | 20 | ```Dockerfile 21 | FROM codingforentrepreneurs/python:3.9-webapp-chromedriver 22 | ``` 23 | 24 | 25 | ### Python 3.9 Webapp Slim 26 | 27 | ```Dockerfile 28 | FROM codingforentrepreneurs/python:3.9-webapp-slim 29 | ``` 30 | 31 | ### Python 3.9 Webapp with Cassandra Driver 32 | 33 | ```Dockerfile 34 | FROM codingforentrepreneurs/python:3.9-webapp-cassandra 35 | ``` 36 | 37 | ### Python 3.9 Webapp with Cassandra Driver & Selenium 38 | 39 | ```Dockerfile 40 | FROM codingforentrepreneurs/python:3.9-webapp-cassandra-selenium 41 | ``` 42 | --------------------------------------------------------------------------------