Skip to content

Commit bbc5883

Browse files
committed
feat(docker): add release process for Docker images with versioning and deployment instructions
1 parent 6210a86 commit bbc5883

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

docs/docker-build.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,55 @@ Check image size:
8080
docker images github-stats
8181
```
8282

83+
## Releasing a New Image
84+
85+
### 1. Bump the version
86+
87+
Update the `version` field in `package.json` before tagging a release (current: `2.1.1`).
88+
89+
### 2. Build and tag
90+
91+
**Node.js image (`Dockerfile`):**
92+
93+
```bash
94+
docker build -t pphatdev/github-stats:2.1.1 -t pphatdev/github-stats:latest .
95+
```
96+
97+
**Bun image (`Dockerfile.bun`):**
98+
99+
```bash
100+
docker build -f Dockerfile.bun -t pphatdev/github-stats:2.1.1-bun -t pphatdev/github-stats:latest-bun .
101+
```
102+
103+
> **Cross-platform tip:** Add `--platform linux/amd64` when building on Apple Silicon for Linux server compatibility:
104+
> ```bash
105+
> docker build --platform linux/amd64 -t pphatdev/github-stats:latest .
106+
> ```
107+
108+
### 3. Push to registry
109+
110+
```bash
111+
docker push pphatdev/github-stats:2.1.1
112+
docker push pphatdev/github-stats:latest
113+
```
114+
115+
### 4. Deploy on a remote server
116+
117+
Pull and restart the container:
118+
119+
```bash
120+
docker pull pphatdev/github-stats:latest
121+
docker stop github-stats && docker rm github-stats
122+
docker run -d --name github-stats -p 3000:3000 --env-file .env pphatdev/github-stats:latest
123+
```
124+
125+
Or with Docker Compose:
126+
127+
```bash
128+
docker compose pull
129+
docker compose up -d --force-recreate
130+
```
131+
83132
## Notes
84133

85134
- `.dockerignore` excludes common local artifacts (`node_modules`, `dist`, `.git`, `.env`, and more) to keep build context small.

0 commit comments

Comments
 (0)