Skip to content

Commit 998cc3c

Browse files
feat: DigitalOcean deployment support with .do config and Deploy button (#49)
* Apply patch [skip ci] * Apply patch [skip ci] * Apply patch [skip ci] * Empty commit to trigger CI --------- Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
1 parent 9fc4ab3 commit 998cc3c

3 files changed

Lines changed: 161 additions & 0 deletions

File tree

.do/app.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: anzu
2+
services:
3+
- name: anzu-web
4+
dockerfile_path: Dockerfile
5+
http_port: 3200
6+
instance_count: 1
7+
instance_size_slug: basic-xxs # Smallest size for testing, user can scale up.
8+
routes:
9+
- path: /
10+
envs:
11+
- key: ENV
12+
value: production
13+
- key: MONGO_URL
14+
value: ${db.DATABASE_URL}
15+
- key: MONGO_NAME
16+
value: ${db.NAME}
17+
- key: REDIS_URL
18+
value: ${cache.INTERNAL_URL}
19+
- key: JWT_SECRET
20+
type: SECRET
21+
value: "CHANGEME" # IMPORTANT: Replace with a long, random string
22+
- key: S3_ENDPOINT
23+
value: "CHANGEME" # e.g., nyc3.digitaloceanspaces.com
24+
- key: S3_ACCESS_KEY_ID
25+
type: SECRET
26+
value: "CHANGEME"
27+
- key: S3_SECRET_ACCESS_KEY
28+
type: SECRET
29+
value: "CHANGEME"
30+
- key: S3_BUCKET_NAME
31+
value: "anzu-assets"
32+
- key: S3_REGION
33+
value: "us-east-1" # Or your bucket's region
34+
- key: OAUTH_GOOGLE_CLIENT_ID
35+
type: SECRET
36+
value: "CHANGEME"
37+
- key: OAUTH_GOOGLE_CLIENT_SECRET
38+
type: SECRET
39+
value: "CHANGEME"
40+
- key: OAUTH_FACEBOOK_CLIENT_ID
41+
type: SECRET
42+
value: "CHANGEME"
43+
- key: OAUTH_FACEBOOK_CLIENT_SECRET
44+
type: SECRET
45+
value: "CHANGEME"
46+
- key: SMTP_HOST
47+
value: "CHANGEME" # e.g., smtp.sendgrid.net
48+
- key: SMTP_PORT
49+
value: "587"
50+
- key: SMTP_USERNAME
51+
type: SECRET
52+
value: "CHANGEME"
53+
- key: SMTP_PASSWORD
54+
type: SECRET
55+
value: "CHANGEME"
56+
- key: SMTP_FROM_EMAIL
57+
value: "CHANGEME" # e.g., no-reply@yourdomain.com
58+
databases:
59+
- name: db
60+
engine: MONGO
61+
- name: cache
62+
engine: REDIS

.do/deploy.template.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
spec:
2+
name: anzu
3+
services:
4+
- name: anzu-web
5+
git:
6+
repo_clone_url: https://github.com/tryanzu/anzu.git
7+
branch: main
8+
dockerfile_path: Dockerfile
9+
http_port: 3200
10+
instance_count: 1
11+
instance_size_slug: basic-xxs # Smallest size for testing, user can scale up.
12+
routes:
13+
- path: /
14+
envs:
15+
- key: ENV
16+
value: production
17+
- key: MONGO_URL
18+
value: ${db.DATABASE_URL}
19+
- key: MONGO_NAME
20+
value: ${db.NAME}
21+
- key: REDIS_URL
22+
value: ${cache.INTERNAL_URL}
23+
- key: JWT_SECRET
24+
type: SECRET
25+
value: "CHANGEME" # IMPORTANT: Replace with a long, random string
26+
- key: S3_ENDPOINT
27+
value: "CHANGEME" # e.g., nyc3.digitaloceanspaces.com
28+
- key: S3_ACCESS_KEY_ID
29+
type: SECRET
30+
value: "CHANGEME"
31+
- key: S3_SECRET_ACCESS_KEY
32+
type: SECRET
33+
value: "CHANGEME"
34+
- key: S3_BUCKET_NAME
35+
value: "anzu-assets"
36+
- key: S3_REGION
37+
value: "us-east-1" # Or your bucket's region
38+
- key: OAUTH_GOOGLE_CLIENT_ID
39+
type: SECRET
40+
value: "CHANGEME"
41+
- key: OAUTH_GOOGLE_CLIENT_SECRET
42+
type: SECRET
43+
value: "CHANGEME"
44+
- key: OAUTH_FACEBOOK_CLIENT_ID
45+
type: SECRET
46+
value: "CHANGEME"
47+
- key: OAUTH_FACEBOOK_CLIENT_SECRET
48+
type: SECRET
49+
value: "CHANGEME"
50+
- key: SMTP_HOST
51+
value: "CHANGEME" # e.g., smtp.sendgrid.net
52+
- key: SMTP_PORT
53+
value: "587"
54+
- key: SMTP_USERNAME
55+
type: SECRET
56+
value: "CHANGEME"
57+
- key: SMTP_PASSWORD
58+
type: SECRET
59+
value: "CHANGEME"
60+
- key: SMTP_FROM_EMAIL
61+
value: "CHANGEME" # e.g., no-reply@yourdomain.com
62+
databases:
63+
- name: db
64+
engine: MONGO
65+
- name: cache
66+
engine: REDIS

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ Whether you're building a gaming community, developer forum, or general discussi
2727

2828
> ⚠️ **Early Development**: Anzu is in active development. While functional, the API and features may change significantly.
2929
30+
## 🚀 Deploy to DigitalOcean
31+
32+
You can deploy Anzu to the DigitalOcean App Platform with a single click.
33+
34+
[![Deploy to DigitalOcean](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/tryanzu/anzu/tree/main)
35+
36+
After deployment, you will need to configure the environment variables in the DigitalOcean App Platform dashboard. See the [Environment Variables](#-environment-variables) section below for more details.
37+
3038
## 🛠️ Tech Stack
3139

3240
- **Backend**: [Go 1.23+](https://golang.org/) with dependency injection
@@ -186,6 +194,31 @@ We appreciate your help in making Anzu better! If you have questions, feel free
186194
- **Discussions**: Join community discussions and get help
187195
- **Wiki**: Additional documentation and guides (coming soon)
188196

197+
### Environment Variables
198+
199+
When deploying to DigitalOcean, you will need to configure the following environment variables in the App Platform dashboard.
200+
201+
| Variable | Type | Required | Description |
202+
| ----------------------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------- |
203+
| `JWT_SECRET` | `Secret` | Yes | A long, random string used to sign JWT tokens. |
204+
| `S3_ENDPOINT` | `String` | Yes | The endpoint for your S3-compatible storage (e.g., `nyc3.digitaloceanspaces.com`). |
205+
| `S3_ACCESS_KEY_ID` | `Secret` | Yes | The access key for your S3-compatible storage. |
206+
| `S3_SECRET_ACCESS_KEY` | `Secret` | Yes | The secret key for your S3-compatible storage. |
207+
| `S3_BUCKET_NAME` | `String` | Yes | The name of the S3 bucket to use for asset storage. |
208+
| `S3_REGION` | `String` | Yes | The region where your S3 bucket is located. |
209+
| `OAUTH_GOOGLE_CLIENT_ID` | `Secret` | No | The client ID for Google OAuth. |
210+
| `OAUTH_GOOGLE_CLIENT_SECRET` | `Secret` | No | The client secret for Google OAuth. |
211+
| `OAUTH_FACEBOOK_CLIENT_ID` | `Secret` | No | The client ID for Facebook OAuth. |
212+
| `OAUTH_FACEBOOK_CLIENT_SECRET`| `Secret` | No | The client secret for Facebook OAuth. |
213+
| `SMTP_HOST` | `String` | No | The hostname of your SMTP server. |
214+
| `SMTP_PORT` | `String` | No | The port of your SMTP server. |
215+
| `SMTP_USERNAME` | `Secret` | No | The username for your SMTP server. |
216+
| `SMTP_PASSWORD` | `Secret` | No | The password for your SMTP server. |
217+
| `SMTP_FROM_EMAIL` | `String` | No | The email address to send emails from. |
218+
| `NEW_RELIC_KEY` | `Secret` | No | Your New Relic license key for application monitoring. |
219+
| `NEW_RELIC_NAME` | `String` | No | The name of your application in New Relic. |
220+
| `SENTRY_URL` | `Secret` | No | The DSN for Sentry error tracking. |
221+
189222
---
190223

191224
<div align="center">

0 commit comments

Comments
 (0)