|
| 1 | +# ☁️ Deploying to Remote Environments |
| 2 | + |
| 3 | +SuperStack is **Docker-native**, so deployments are simple, consistent, and |
| 4 | +portable. The goal is that only `compose.yaml` and secrets need to exist on the |
| 5 | +remote server. |
| 6 | + |
| 7 | +## Prepare your Application |
| 8 | + |
| 9 | +Services that are built (they have a `build:` section in `compose.yaml`), add |
| 10 | +your own container repository image URIs (e.g. your Docker Hub or GitHub |
| 11 | +Container Registry account), for example: |
| 12 | + |
| 13 | +```yaml title="compose.yaml" |
| 14 | +services: |
| 15 | + caddy: |
| 16 | + build: |
| 17 | + context: ./caddy |
| 18 | + image: ghcr.io/youruser/yourapp-caddy:0.1.0 |
| 19 | +``` |
| 20 | +
|
| 21 | +Build and push your images: |
| 22 | +
|
| 23 | +```sh |
| 24 | +docker compose build |
| 25 | +docker compose push |
| 26 | +``` |
| 27 | + |
| 28 | +## 📦 Deploy |
| 29 | + |
| 30 | +Copy `compose.yaml` to the server: |
| 31 | + |
| 32 | +```sh |
| 33 | +scp compose.yaml youruser@yourserver: |
| 34 | +``` |
| 35 | + |
| 36 | +### Secrets |
| 37 | + |
| 38 | +The app also needs your secrets (passwords, keys, etc.). |
| 39 | + |
| 40 | +There are a few options: |
| 41 | + |
| 42 | +1. Put secrets in a `.env` file on the server, alongside your compose.yaml. |
| 43 | + Convenient but Less secure. Be sure to `chmod 600 .env`. |
| 44 | +1. Set environment variables in the the `docker compose` command. Inconvenient. |
| 45 | + Be sure to disable shell history. |
| 46 | +1. Use environment injection in CI/CD. |
| 47 | + |
| 48 | +## 🚀 Launch your Stack |
| 49 | + |
| 50 | +Bring up the stack: |
| 51 | + |
| 52 | +```sh |
| 53 | +docker compose pull |
| 54 | +docker compose up -d |
| 55 | +``` |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +That’s it — your backend is live. |
| 60 | + |
| 61 | +This type of rolling deployment makes it hard to test before going live and to |
| 62 | +rollback, and can have some downtime while upgrading. Consider reading the Wiki |
| 63 | +page on [Advanced Deployments](). |
| 64 | + |
| 65 | +## Github Actions Workflow |
| 66 | + |
| 67 | +TODO |
0 commit comments