Repository navigation
Add Docker Container - #687
RicardoJeronimo wants to merge 178 commits into
Conversation
Added basic proxy support from environment variables, need to add this option in parameter of patchman cli.
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Login to Docker Hub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ vars.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Build and push | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| file: docker/Dockerfile | ||
| platforms: linux/amd64,linux/arm64 | ||
| push: true | ||
| tags: ${{vars.DOCKERHUB_USERNAME}}/${{vars.DOCKERHUB_CONTAINER}}:latest,${{vars.DOCKERHUB_USERNAME}}/${{vars.DOCKERHUB_CONTAINER}}:${{github.ref_name}} | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
|
|
||
| - name: Checkout for next job | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Docker Hub Description | ||
| uses: peter-evans/dockerhub-description@v4 | ||
| with: | ||
| username: ${{ vars.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
| repository: ${{vars.DOCKERHUB_USERNAME}}/${{vars.DOCKERHUB_CONTAINER}} | ||
| readme-filepath: docker/README.md |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
|
I would highly recommend adding a push to GHCR as well as Docker Hub. Docker Hub imposes strict rate limits on pulls these days, which can cause problems in some environments. If nothing else, I think it's always a good idea to have multiple sources for the image in case of platform outages 🙂 Additionally, the use of docker/metadata-action would be useful for the addition of labels/annotations and tagging logic (versions etc.). While it's not my proudest piece of work, some working examples of all this can be seen here: tigattack/Patchman-Docker/.github/workflows/build.yml |
Adding:
The entrypoint script allows environment variables to be used in order to configure settings in local_settings.py, choose database backends, Memcached server and Redis broker. If a Redis broker is configured, the script asynchronously starts Celery alongside Apache httpd.