templates/README.md
2026-12-01 13:45:49 +02:00

76 lines
3.2 KiB
Markdown

<p align="center"><img src="assets/logo.png" alt="Interweb" width="280"></p>
# Interweb Angola VPS templates
<!-- badges:start -->
[![Release](https://git.interweb.ao/interweb-ao/templates/badges/release.svg)](https://git.interweb.ao/interweb-ao/templates/releases) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
<!-- badges:end -->
[Português](README-pt.md)
Small example projects, ready to publish on a Interweb Angola VPS with Docker Compose. Each one has HTTPS out of the box: [Caddy](https://caddyserver.com) gets and renews the certificate for your domain on its own.
| Template | What it is |
|---|---|
| [static-site](static-site/) | HTML and CSS files, served by Caddy. |
| [node-app](node-app/) | A Node.js app with no dependencies, behind Caddy. |
| [php-app](php-app/) | A PHP site with a contact form, on PHP-FPM behind Caddy. |
| [wordpress](wordpress/) | WordPress with MariaDB, behind Caddy, with a backup script. |
## What you need
- A Interweb Angola VPS with Ubuntu or Debian, Docker and the Docker Compose plugin, and ports 80 and 443 open.
- SSH access to the server, ideally with a key.
- A domain whose DNS points to the server (see below).
- `ssh` and `rsync` on your computer.
## Publish in 4 steps
**1. Find the IP of your server** with the [Interweb Angola API](https://docs.interweb.ao/servers/), or in Meu Interweb:
```bash
export INTERWEB_API_KEY="prod_..."
curl -sS "https://api.interweb.ao/v1/servers" -H "Authorization: Bearer $INTERWEB_API_KEY"
```
The `ip` field is the address. The key needs `vps:read`.
**2. Point the domain** to that IP. If the domain uses Interweb Angola DNS, add the records through the API (the key needs `dns:write`):
```bash
for name in @ www; do
curl -sS -X POST "https://api.interweb.ao/v1/domains/mybusiness.co.ao/dns" \
-H "Authorization: Bearer $INTERWEB_API_KEY" -H "Content-Type: application/json" \
-d "{\"name\": \"$name\", \"type\": \"A\", \"value\": \"203.0.113.10\", \"ttl\": 3600}"
done
```
Replace `203.0.113.10` with the IP from step 1. If a record with that name already exists, change it instead. See [DNS](https://docs.interweb.ao/dns/).
**3. Copy the template to the server and create its settings:**
```bash
sh deploy.sh static-site root@203.0.113.10
```
The first time, `deploy.sh` creates `.env` on the server from `.env.example` and stops. Edit it on the server (`ssh root@203.0.113.10 nano /srv/static-site/.env`), at least `DOMAIN`.
**4. Run it again** to start the site:
```bash
sh deploy.sh static-site root@203.0.113.10
```
Open `https://mybusiness.co.ao`. The first visit can take a few seconds while Caddy gets the certificate.
To update, change the files and run step 4 again. `.env` stays on the server and is never copied or deleted.
## With an AI agent
With the [Interweb Angola plugin for Claude Code](https://git.interweb.ao/interweb-ao/claude-plugin), ask "deploy this project to my VPS": the `deploy-to-vps` and `connect-domain` skills follow these same steps and ask before each change.
---
Create your API key in the [API Center](https://www.meu.interweb.ao/api-center.php) of Meu Interweb. Documentation: https://docs.interweb.ao
Maintained by RLX Holdings.