fix(docker): add OCI labels, workspace fix, retry logic, and Docker Hub README sync
Swadhin Biswas committed 5 months ago
d542961
1 parent c2c1cb3
commit d542961
2 files changed
+33 -3
Showing 2 changed files+33-3
▼.github/workflows/docker-publish.yml
+23-2
| @@ -27,8 +27,8 @@ jobs: | ||
27 | 27 | - name: Log in to DockerHub |
28 | 28 | uses: docker/login-action@v3 |
29 | 29 | with: |
30 | - username: ${{ secrets.DOCKERHUB_USERNAME }} | |
31 | - password: ${{ secrets.DOCKERHUB_TOKEN }} | |
30 | + username: ${{ secrets.DOCKER_USERNAME }} | |
31 | + password: ${{ secrets.DOCKER_TOKEN }} | |
32 | 32 | |
33 | 33 | - name: Extract metadata |
34 | 34 | id: meta |
| @@ -41,6 +41,12 @@ jobs: | ||
41 | 41 | type=semver,pattern={{major}}.{{minor}} |
42 | 42 | type=sha,prefix= |
43 | 43 | type=raw,value=latest,enable={{is_default_branch}} |
44 | + labels: | | |
45 | + org.opencontainers.image.title=OpenCodeHub | |
46 | + org.opencontainers.image.description=A modern, self-hosted Git platform for teams that want speed, control, and clean workflows. | |
47 | + org.opencontainers.image.url=https://github.com/swadhinbiswas/OpencodeHub | |
48 | + org.opencontainers.image.source=https://github.com/swadhinbiswas/OpencodeHub | |
49 | + org.opencontainers.image.licenses=MIT | |
44 | 50 | |
45 | 51 | - name: Build and push app image |
46 | 52 | uses: docker/build-push-action@v5 |
| @@ -63,5 +69,20 @@ jobs: | ||
63 | 69 | tags: | |
64 | 70 | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-runner:latest |
65 | 71 | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-runner:${{ github.sha }} |
72 | + labels: | | |
73 | + org.opencontainers.image.title=OpenCodeHub Runner | |
74 | + org.opencontainers.image.description=CI/CD runner for OpenCodeHub | |
75 | + org.opencontainers.image.url=https://github.com/swadhinbiswas/OpencodeHub | |
76 | + org.opencontainers.image.source=https://github.com/swadhinbiswas/OpencodeHub | |
77 | + org.opencontainers.image.licenses=MIT | |
66 | 78 | cache-from: type=gha |
67 | 79 | cache-to: type=gha,mode=max |
80 | + | |
81 | + - name: Update Docker Hub Repository Description | |
82 | + uses: peter-evans/dockerhub-description@v4 | |
83 | + with: | |
84 | + username: ${{ secrets.DOCKER_USERNAME }} | |
85 | + password: ${{ secrets.DOCKER_TOKEN }} | |
86 | + repository: ${{ env.IMAGE_NAME }} | |
87 | + readme-filepath: ./README.md | |
88 | + short-description: "A modern, self-hosted Git platform with stacked PRs, merge queue, CI/CD, and AI review." | |
68 | 89 | |
▼Dockerfile
+10-1
| @@ -1,11 +1,20 @@ | ||
1 | 1 | FROM oven/bun:1 AS base |
2 | 2 | WORKDIR /app |
3 | +LABEL org.opencontainers.image.title="OpenCodeHub" \ | |
4 | + org.opencontainers.image.description="A modern, self-hosted Git platform with stacked PRs, merge queue, CI/CD, and AI review." \ | |
5 | + org.opencontainers.image.url="https://github.com/swadhinbiswas/OpencodeHub" \ | |
6 | + org.opencontainers.image.source="https://github.com/swadhinbiswas/OpencodeHub" \ | |
7 | + org.opencontainers.image.licenses="MIT" | |
3 | 8 | |
4 | 9 | # Install dependencies |
5 | 10 | FROM base AS deps |
6 | 11 | RUN apt-get update && apt-get install -y python3 make g++ gcc libc6-dev && rm -rf /var/lib/apt/lists/* |
7 | 12 | COPY package.json bun.lock ./ |
8 | -RUN bun install --frozen-lockfile | |
13 | +COPY cli/package.json ./cli/package.json | |
14 | +RUN for i in 1 2 3; do \ | |
15 | + bun install --frozen-lockfile && break || \ | |
16 | + (echo "bun install attempt $i failed, retrying in 10s..." && sleep 10); \ | |
17 | + done | |
9 | 18 | |
10 | 19 | # Build the application |
11 | 20 | FROM base AS builder |
12 | 21 | |