Skip to content

Commit 56ed7df

Browse files
committed
feat: Complete modernization of stack
1 parent 9783b28 commit 56ed7df

46 files changed

Lines changed: 1385 additions & 2365 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1-
node_modules
1+
node_modules
2+
dist
3+
.git
4+
.gitignore
5+
*.md
6+
.env
7+
.env.local
8+
.vscode
9+
.idea
10+
*.log
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
count.db
15+

.env.example

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
# Specify your website URL
2-
# APP_SITE=https://count.getloli.com
2+
# APP_SITE=https://count.example.com
33

44
# Application port
55
APP_PORT=3000
66

7-
# Database type: either 'sqlite' or 'mongodb'
8-
DB_TYPE=sqlite
9-
10-
# If using MongoDB, provide the connection string
11-
# DB_URL=mongodb://127.0.0.1:27017
7+
# Redis connection URL
8+
REDIS_URL=redis://127.0.0.1:6379
129

1310
# Database write interval in seconds (0 for real-time)
1411
DB_INTERVAL=60
1512

1613
# Log level: either 'debug' | 'info' | 'warn' | 'error' | 'none'
17-
LOG_LEVEL=debug
18-
19-
# Google Analytics `G-Tag` ID
20-
# GA_ID=G-XXXX
14+
LOG_LEVEL=info

.github/workflows/docker.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
jobs:
13+
build-amd64:
14+
runs-on: runs-on=${{ github.run_id }}/runner=4cpu-linux-x64
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
23+
- name: Login to GitHub Container Registry
24+
uses: docker/login-action@v3
25+
with:
26+
registry: ghcr.io
27+
username: ${{ github.repository_owner }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Build and push (AMD64)
31+
uses: docker/build-push-action@v6
32+
with:
33+
platforms: linux/amd64
34+
context: .
35+
push: true
36+
tags: |
37+
ghcr.io/${{ github.repository }}:latest-amd
38+
ghcr.io/${{ github.repository }}:${{ github.sha }}-amd
39+
40+
build-arm64:
41+
runs-on: runs-on=${{ github.run_id }}/runner=4cpu-linux-arm64
42+
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v4
46+
47+
- name: Set up Docker Buildx
48+
uses: docker/setup-buildx-action@v3
49+
50+
- name: Login to GitHub Container Registry
51+
uses: docker/login-action@v3
52+
with:
53+
registry: ghcr.io
54+
username: ${{ github.repository_owner }}
55+
password: ${{ secrets.GITHUB_TOKEN }}
56+
57+
- name: Build and push (ARM64)
58+
uses: docker/build-push-action@v6
59+
with:
60+
platforms: linux/arm64
61+
context: .
62+
push: true
63+
tags: |
64+
ghcr.io/${{ github.repository }}:latest-arm
65+
ghcr.io/${{ github.repository }}:${{ github.sha }}-arm
66+
67+
build-merge:
68+
runs-on: ubuntu-latest
69+
70+
needs:
71+
- build-amd64
72+
- build-arm64
73+
74+
steps:
75+
- name: Set up Docker Buildx
76+
uses: docker/setup-buildx-action@v3
77+
78+
- name: Login to GHCR
79+
uses: docker/login-action@v3
80+
with:
81+
registry: ghcr.io
82+
username: ${{ github.repository_owner }}
83+
password: ${{ secrets.GITHUB_TOKEN }}
84+
85+
- name: Merge
86+
run: |
87+
docker buildx imagetools create -t ghcr.io/${{ github.repository }}:latest \
88+
ghcr.io/${{ github.repository }}:latest-amd \
89+
ghcr.io/${{ github.repository }}:latest-arm

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ count.db
2323
.env.production.local
2424

2525
npm-debug.log*
26+
27+
/dist

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/BetterMoeCounter.iml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copilot.data.migration.agent.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copilot.data.migration.ask.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copilot.data.migration.ask2agent.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copilot.data.migration.edit.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)