mirror of
https://github.com/sstent/minihass.git
synced 2025-12-06 03:21:36 +00:00
working
This commit is contained in:
24
.github/workflows/container-build.yml
vendored
24
.github/workflows/container-build.yml
vendored
@@ -7,7 +7,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- 'app.py'
|
- 'app.py'
|
||||||
- 'dockerfile'
|
- 'Dockerfile'
|
||||||
- 'requirements.txt'
|
- 'requirements.txt'
|
||||||
- 'docker-compose.yml'
|
- 'docker-compose.yml'
|
||||||
|
|
||||||
@@ -32,6 +32,24 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Create multi-arch Dockerfile
|
||||||
|
run: |
|
||||||
|
cat > Dockerfile <<EOF
|
||||||
|
FROM --platform=\$BUILDPLATFORM python:3.11-slim as builder
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY requirements.txt .
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
FROM python:3.11-slim
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
|
||||||
|
COPY --from=builder /usr/local/bin /usr/local/bin
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
CMD ["python", "app.py"]
|
||||||
|
EOF
|
||||||
|
|
||||||
- name: Build and push multi-arch Docker image
|
- name: Build and push multi-arch Docker image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
@@ -42,4 +60,6 @@ jobs:
|
|||||||
ghcr.io/${{ github.repository }}:latest
|
ghcr.io/${{ github.repository }}:latest
|
||||||
ghcr.io/${{ github.repository }}:${{ github.sha }}
|
ghcr.io/${{ github.repository }}:${{ github.sha }}
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
provenance: false
|
||||||
|
sbom: false
|
||||||
Reference in New Issue
Block a user