Skip to content

Commit ead3249

Browse files
DaxServerclaude
andauthored
chore: setup docker image (#85)
* chore: setup docker image * chore: update dockerfile * fix: restore poetry install in Dockerfile Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore: remove unnecessary poetry install steps from workflow Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore: increase throttle, docker build on main --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 391a520 commit ead3249

4 files changed

Lines changed: 61 additions & 10 deletions

File tree

‎.dockerignore‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
.ai*
1+
.claude
22
.git*
33
.poetry
4-
.venv
4+
.pytest_cache
5+
.ruff*
6+
.vscode
57
__pycache__
68
apicache
7-
ignored
8-
9-
pywikibot-*.lwp
10-
throttle.ctrl
11-
user-password.py
12-
*.sh

‎.github/workflows/docker.yml‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Docker
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
attestations: write
19+
id-token: write
20+
21+
steps:
22+
- uses: actions/checkout@v6
23+
24+
- uses: docker/login-action@v4
25+
with:
26+
registry: ghcr.io
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Extract metadata (tags, labels) for Docker
31+
id: meta
32+
uses: docker/metadata-action@v6
33+
with:
34+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
35+
36+
- name: Setup Docker Buildx
37+
uses: docker/setup-buildx-action@v4
38+
39+
- name: Build and push Docker image
40+
id: push
41+
uses: docker/build-push-action@v7
42+
with:
43+
context: .
44+
push: true
45+
tags: ${{ steps.meta.outputs.tags }}
46+
labels: ${{ steps.meta.outputs.labels }}
47+
cache-from: type=gha
48+
cache-to: type=gha,mode=max
49+
50+
- name: Generate artifact attestation
51+
uses: actions/attest-build-provenance@v4
52+
with:
53+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
54+
subject-digest: ${{ steps.push.outputs.digest }}
55+
push-to-registry: true

‎Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.13.12-alpine3.23
1+
FROM python:3.13.13-alpine3.23
22

33
RUN pip install poetry
44

‎src/wikibots/lib/bot.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class RateLimitExhausted(Exception):
3333
class BaseBot(ClaimsMixin):
3434
summary = "add [[Commons:Structured data|SDC]] based on metadata"
3535
redis_prefix = ""
36-
throttle = 5
36+
throttle = 10
3737
search_query = ""
3838
always_null_edit = False
3939

0 commit comments

Comments
 (0)