Skip to content

Commit

Permalink
⚡️ Improve speed by using Docker underneath (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo authored Sep 7, 2024
1 parent 918ef3d commit f483f1a
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 11 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Docker Deploy

on:
push:
branches:
- main
release:
types:
- published

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64
tags: |
tiangolo/issue-manager:latest
ghcr.io/tiangolo/issue-manager:latest
file: base.dockerfile
- name: Build and push tag
if: github.event_name == 'release'
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64
tags: |
tiangolo/issue-manager:${{ github.event.release.tag_name }}
ghcr.io/tiangolo/issue-manager:${{ github.event.release.tag_name }}
file: base.dockerfile
12 changes: 1 addition & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
FROM python:3.10

COPY ./requirements.txt /code/requirements.txt

RUN pip install -r /code/requirements.txt

COPY ./app /code/app

ENV PYTHONPATH=/code/app

CMD ["python", "/code/app/main.py"]
FROM tiangolo/issue-manager:0.5.0
11 changes: 11 additions & 0 deletions base.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3.10-slim

COPY ./requirements.txt /code/requirements.txt

RUN pip install -r /code/requirements.txt

COPY ./app /code/app

ENV PYTHONPATH=/code/app

CMD ["python", "/code/app/main.py"]

0 comments on commit f483f1a

Please sign in to comment.