Skip to content

Commit 5a70d15

Browse files
committed
Publish OCI containers to GitHub registry
1 parent f27c96e commit 5a70d15

File tree

9 files changed

+125
-84
lines changed

9 files changed

+125
-84
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.env
2-
Dockerfile
2+
Containerfile
33
.dockerignore
44
.git
55
.gitignore

.github/workflows/release.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
release:
8+
types: [published]
9+
workflow_dispatch:
10+
11+
jobs:
12+
13+
backend-container:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
attestations: write
19+
id-token: write
20+
env:
21+
REGISTRY: ghcr.io
22+
IMAGE_NAME: ${{ github.repository }}
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
- name: Log in to the Container registry
28+
uses: docker/login-action@v3
29+
with:
30+
registry: ${{ env.REGISTRY }}
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
- name: Extract metadata (tags, labels) for Docker
34+
id: meta
35+
uses: docker/metadata-action@v5
36+
with:
37+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
38+
- name: Build and push Docker image
39+
id: push
40+
uses: docker/build-push-action@v6
41+
with:
42+
context: .
43+
file: Containerfile
44+
push: true
45+
tags: ${{ steps.meta.outputs.tags }}
46+
labels: ${{ steps.meta.outputs.labels }}
47+
48+
- name: Generate artifact attestation
49+
uses: actions/attest-build-provenance@v2
50+
with:
51+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
52+
subject-digest: ${{ steps.push.outputs.digest }}
53+
push-to-registry: true
54+
55+
frontend-container:
56+
runs-on: ubuntu-latest
57+
permissions:
58+
contents: read
59+
packages: write
60+
attestations: write
61+
id-token: write
62+
env:
63+
REGISTRY: ghcr.io
64+
IMAGE_NAME: ${{ github.repository }}-web
65+
66+
steps:
67+
- name: Checkout repository
68+
uses: actions/checkout@v4
69+
- name: Log in to the Container registry
70+
uses: docker/login-action@v3
71+
with:
72+
registry: ${{ env.REGISTRY }}
73+
username: ${{ github.actor }}
74+
password: ${{ secrets.GITHUB_TOKEN }}
75+
- name: Extract metadata (tags, labels) for Docker
76+
id: meta
77+
uses: docker/metadata-action@v5
78+
with:
79+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
80+
- name: Build and push Docker image
81+
id: push
82+
uses: docker/build-push-action@v6
83+
with:
84+
context: web
85+
file: Containerfile
86+
push: true
87+
tags: ${{ steps.meta.outputs.tags }}
88+
labels: ${{ steps.meta.outputs.labels }}
89+
90+
- name: Generate artifact attestation
91+
uses: actions/attest-build-provenance@v2
92+
with:
93+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
94+
subject-digest: ${{ steps.push.outputs.digest }}
95+
push-to-registry: true

Containerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM ghcr.io/astral-sh/uv:python3.12-alpine
2+
3+
WORKDIR /app
4+
COPY . /app
5+
6+
RUN uv sync --locked --no-dev
7+
8+
EXPOSE 8000
9+
10+
CMD ["uv", "run", "python", "server.py", "--host", "0.0.0.0", "--port", "8000"]

Dockerfile

Lines changed: 0 additions & 24 deletions
This file was deleted.

docker-compose.yml renamed to compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ services:
22
backend:
33
build:
44
context: .
5-
dockerfile: Dockerfile
5+
dockerfile: Containerfile
66
container_name: deer-flow-backend
77
ports:
88
- "8000:8000"
@@ -17,7 +17,7 @@ services:
1717
frontend:
1818
build:
1919
context: ./web
20-
dockerfile: Dockerfile
20+
dockerfile: Containerfile
2121
args:
2222
- NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
2323
container_name: deer-flow-frontend

web/.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.env
2-
Dockerfile
2+
Containerfile
33
.dockerignore
44
node_modules
55
npm-debug.log

web/Containerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM node:20-alpine
2+
WORKDIR /app
3+
4+
ENV NODE_ENV=production
5+
ENV NEXT_TELEMETRY_DISABLED=1
6+
ENV PORT=3000
7+
8+
RUN apk add --no-cache pnpm
9+
10+
COPY . /app
11+
RUN pnpm i
12+
13+
EXPOSE 3000
14+
15+
CMD ["sh"]

web/Dockerfile

Lines changed: 0 additions & 55 deletions
This file was deleted.

web/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ services:
22
deer-flow-web:
33
build:
44
context: .
5-
dockerfile: Dockerfile
5+
dockerfile: Containerfile
66
args:
77
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL}
88
image: deer-flow-web

0 commit comments

Comments
 (0)