Mineflappy: Minecraft Flappy Bird with 6 birds, abilities, biomes and Docker deployment

Single-file HTML5 canvas game - sprites, bitmap font, music and sound are
all generated in code, no external assets.

Game:
- 6 playable birds, each with a unique ability (Double Flap, Teleport,
  Allay Magnet, Melt, Phase, Howl)
- 5 score-driven biomes (Plains, Desert, Mineshaft, Nether, Ice Peaks)
- Day/night cycle, weather (rain, snow, embers), camera drift
- Pickups: gold, bubble shield, elytra wings, lucky cube buffs
- Difficulty settings, bird unlocks, per-bird bests, advancement toasts
- Daily challenge with a shareable code and a ghost of your best run
- 2-player on one screen

Deployment:
- Dockerfile (nginx:alpine) serving the single file
- nginx.conf with no-cache headers, gzip and a /healthz endpoint
- docker-compose.yml and Coolify instructions in the README
This commit is contained in:
Dave 2026-10-23 19:14:43 +02:00
commit 54f94097e1
7 changed files with 1995 additions and 0 deletions

8
.dockerignore Normal file
View file

@ -0,0 +1,8 @@
.git
.gitignore
Dockerfile
docker-compose.yml
README.md
*.md
.DS_Store
*.log

5
.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
.DS_Store
*.log
*.swp
.idea/
.vscode/

20
Dockerfile Normal file
View file

@ -0,0 +1,20 @@
# Mineflappy — Minecraft Flappy Bird
# A single static page served by nginx. No build step, no Node runtime.
FROM nginx:1.27-alpine
LABEL org.opencontainers.image.title="Mineflappy" \
org.opencontainers.image.description="Minecraft Flappy Bird - single file static game" \
org.opencontainers.image.licenses="MIT"
# Replace nginx's placeholder page with the game
RUN rm -f /usr/share/nginx/html/index.html
COPY index.html /usr/share/nginx/html/index.html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
# Coolify/Traefik use this to decide the container is live
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget -q --spider http://127.0.0.1/ || exit 1
CMD ["nginx", "-g", "daemon off;"]

97
README.md Normal file
View file

@ -0,0 +1,97 @@
# Mineflappy
**Minecraft Flappy Bird** — a single-file HTML5 canvas game. No build step, no
dependencies, no assets. Everything (sprites, font, music, sound) is generated
in code.
```
open index.html # that's it - it runs straight from the filesystem
```
---
## Deploy to Coolify
### Option A - Dockerfile (recommended)
The repo ships a `Dockerfile` that serves the game with nginx.
1. In Coolify: **New Resource → Application → Public/Private Repository**
2. **Repository URL**: `http://forgejo-b82b4lpyyzyg40thdsjdd38i.163.245.214.68.sslip.io/David/MINEFLAPPY-GAME.git`
- Branch: `main`
- Build Pack: **Dockerfile**
3. **Dockerfile Location**: `/Dockerfile` (default is fine)
4. **Port**: `80`
5. **Health Check Path**: `/healthz`
6. Hit **Deploy**.
7. Add a domain: **Settings → Domains → Add Domain** - e.g. `game.yourdomain.com`
- Tick **Force HTTPS** and let Coolify/Traefik issue the Let's Encrypt cert.
- Coolify routes the domain to the container's port 80 automatically.
Push a new commit and Coolify rebuilds and redeploys it.
### Option B - Static Site (no Dockerfile)
If you'd rather not run a container:
1. **New Resource → Static Site** with the same repo
2. **Build Command**: `echo "static"` (there is nothing to build)
3. **Root Directory**: `/`
4. Deploy, then attach a domain as above.
### Option C - docker compose
A `docker-compose.yml` is included if you deploy by compose instead:
```bash
docker compose up -d --build
# game is on http://localhost:8080
```
---
## Run it locally with Docker
```bash
docker build -t mineflappy .
docker run --rm -p 8080:80 mineflappy
# open http://localhost:8080
```
---
## Layout
| File | What it is |
|---|---|
| `index.html` | The entire game - markup, CSS and JS in one file |
| `Dockerfile` | nginx:alpine image that serves `index.html` |
| `nginx.conf` | Server config: no-cache on the game, gzip, `/healthz` |
| `docker-compose.yml` | Optional compose deployment |
---
## The game
Six birds, each with one ability:
| Bird | Ability | Effect |
|---|---|---|
| Chicken | Double Flap | Every 4th flap is 34% stronger |
| Enderman | Teleport | Blink 70px forward (refused if a pipe is in the way) |
| Allay | Allay Magnet | Nearby gems fly to you |
| Blaze | Melt | Burns away the next pipe, widening its gap |
| Phantom | Phase | Fly through anything for 1.2s |
| Wolf | Howl | Slows the whole game to 55% for 2s |
Also in: five biomes that change with your score (Plains → Desert → Mineshaft →
Nether → Ice Peaks), a day/night cycle, weather, gold/bubble/wings/lucky-cube
pickups, difficulty settings, bird unlocks, per-bird best scores, a daily
challenge with a shareable code, a ghost of your best run, and 2-player on one
screen.
**Controls** - `Space` / `W` / `↑` / tap to flap, `F` to use your ability,
`P` to pause, `C` on the game-over screen to change bird. In 2-player mode
`Space` is player 1 and `↑` is player 2.
Progress is stored in `localStorage` under `mineflappy_v2`.

16
docker-compose.yml Normal file
View file

@ -0,0 +1,16 @@
services:
game:
build:
context: .
dockerfile: Dockerfile
image: mineflappy:latest
container_name: mineflappy
ports:
- "8080:80"
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1/"]
interval: 30s
timeout: 3s
retries: 3
start_period: 5s

1816
index.html Normal file

File diff suppressed because it is too large Load diff

33
nginx.conf Normal file
View file

@ -0,0 +1,33 @@
server {
listen 80;
listen [::]:80;
server_name _;
root /usr/share/nginx/html;
index index.html;
server_tokens off;
charset utf-8;
# The game is one file - never cache it, so a redeploy shows up at once
location = /index.html {
add_header Cache-Control "no-cache, no-store, must-revalidate" always;
try_files $uri =404;
}
location = /healthz {
access_log off;
default_type text/plain;
return 200 "ok\n";
}
location / {
try_files $uri $uri/ =404;
}
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_comp_level 5;
gzip_types text/plain text/css application/javascript application/json image/svg+xml;
}