From 4bda1903c7c0d2a8399eb92c53bf0e06a48cf0fd Mon Sep 17 00:00:00 2001 From: Mauro de Souza Date: Tue, 5 May 2026 20:40:14 -0300 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=90=B3=20=20docker:=20add=20docker=20?= =?UTF-8?q?for=20production=20and=20.dockerignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 18 ++++++++++++++++++ Dockerfile.prod | 13 +++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile.prod diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..73bd2286 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,18 @@ +.git +.github +.vscode +.idea +.env +*.sh +**/.DS_Store +test/ +README.md +CONTRIBUTING.md +LICENSE +action.yml +vercel.json +.vercelignore +.editorconfig +docker-compose.yml +Dockerfile +Dockerfile.prod diff --git a/Dockerfile.prod b/Dockerfile.prod new file mode 100644 index 00000000..2f7c0c42 --- /dev/null +++ b/Dockerfile.prod @@ -0,0 +1,13 @@ +FROM denoland/deno:alpine-2.3.3 + +WORKDIR /app + +COPY --chown=deno:deno . . + +USER deno + +RUN deno cache main.ts + +EXPOSE 8080 + +CMD ["deno", "run", "--allow-net", "--allow-env", "--allow-read=./", "main.ts"] From 0157fd548dd1f807a4cbc5254d2f842f36268724 Mon Sep 17 00:00:00 2001 From: Mauro de Souza Date: Tue, 5 May 2026 21:06:52 -0300 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=90=9B=20=20fix:=20directory=20permis?= =?UTF-8?q?sions=20in=20production=20dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile.prod | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile.prod b/Dockerfile.prod index 2f7c0c42..b8320312 100644 --- a/Dockerfile.prod +++ b/Dockerfile.prod @@ -1,5 +1,6 @@ FROM denoland/deno:alpine-2.3.3 +RUN mkdir -p /app && chown deno:deno /app WORKDIR /app COPY --chown=deno:deno . . From e957d12c6bed3f37cd7059e057f0aad00cbc23ea Mon Sep 17 00:00:00 2001 From: Mauro de Souza Date: Tue, 5 May 2026 21:29:20 -0300 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=93=84=20=20docs:=20add=20self-hostin?= =?UTF-8?q?g=20guide=20with=20Docker=20and=20Coolify=20deployment=20instru?= =?UTF-8?q?ctions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/README.md b/README.md index 96a4462c..e9340ecf 100644 --- a/README.md +++ b/README.md @@ -611,6 +611,47 @@ Usage: token: ${{ secrets.GITHUB_TOKEN }} ``` +# Self-hosting with Docker + +You can host your own instance using the provided `Dockerfile.prod`. + +## Environment Variables + +| Variable | Required | Default | Description | +| --- | --- | --- | --- | +| `PORT` | No | `8080` | Port the server listens on | +| `GITHUB_TOKEN1` | Yes | — | GitHub personal access token | +| `GITHUB_TOKEN2` | No | — | Secondary token for load balancing | +| `GITHUB_API` | No | `https://api.github.com/graphql` | GitHub GraphQL API endpoint | +| `ENABLE_REDIS` | No | — | Set to `true` to enable Redis caching | +| `REDIS_HOST` | No | — | Redis host | +| `REDIS_PORT` | No | `6379` | Redis port | +| `REDIS_USERNAME` | No | — | Redis username | +| `REDIS_PASSWORD` | No | — | Redis password | + +## Build & run locally + +```bash +# Build +docker build -f Dockerfile.prod -t github-profile-trophy . + +# Run +docker run -p 8080:8080 \ + -e GITHUB_TOKEN1=your_token \ + github-profile-trophy +``` + +## Deploy with Coolify + +1. In the Coolify dashboard, create a new **Resource** → **Public Repository** (or Private, if configured). +2. Set the **Build Pack** to `Dockerfile`. +3. Set the **Dockerfile Path** to `Dockerfile.prod`. +4. Under **Environment Variables**, add the variables from the table above (at minimum `GITHUB_TOKEN1`). +5. Set the **Port** to `8080` (or your custom `PORT`). +6. Click **Deploy**. + +> **Redis**: if you want caching, provision a Redis instance separately (e.g. Coolify's built-in Redis service) and pass its connection details via `REDIS_HOST`, `REDIS_PORT`, `REDIS_USERNAME`, and `REDIS_PASSWORD`, setting `ENABLE_REDIS=true`. + # Contribution Guide Check [CONTRIBUTING.md](./CONTRIBUTING.md) for more details.