Skip to content

Commit aa398a1

Browse files
committed
Add DigitalOcean app config
1 parent adb6490 commit aa398a1

File tree

6 files changed

+48
-2
lines changed

6 files changed

+48
-2
lines changed

.do/app.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: backwave
2+
services:
3+
- name: backend
4+
github:
5+
repo: codevalley/backwave
6+
branch: main
7+
deploy_on_push: true
8+
source_dir: /
9+
envs:
10+
- key: MONGO_URI
11+
value: ${MONGO_URI}
12+
- key: PORT
13+
value: ${backend.PORT}
14+
- name: frontend
15+
github:
16+
repo: codevalley/backwave
17+
branch: main
18+
deploy_on_push: true
19+
source_dir: webapp
20+
envs:
21+
- key: VUE_APP_API_URL
22+
value: ${backend.INTERNAL_URL}

Procfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: gunicorn --bind 0.0.0.0:$PORT app:app

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,21 @@ Replace `{survey_id}` with the actual survey ID from your created survey.
138138

139139
For detailed API documentation, refer to the [api_endpoints.md](api_endpoints.md) file.
140140

141+
## Setting up Environment Variables in DigitalOcean App Platform
142+
143+
After creating your app in DigitalOcean App Platform:
144+
145+
1. Go to the App Platform dashboard and select your app.
146+
2. Click on the "Settings" tab.
147+
3. Scroll down to the "Environment Variables" section.
148+
4. Click "Edit" and then "Add Variable".
149+
5. Add a new variable:
150+
- Key: MONGO_URI
151+
- Value: Your MongoDB connection string (e.g., mongodb+srv://username:password@cluster.mongodb.net/database?retryWrites=true&w=majority)
152+
6. Click "Save".
153+
154+
The ${backend.INTERNAL_URL} and ${backend.PORT} variables are automatically set by DigitalOcean App Platform, so you don't need to configure them manually.
155+
141156
## Troubleshooting
142157

143158
1. If you encounter CORS issues:

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ dnspython
55
Werkzeug==2.2.2
66
requests
77
flask-cors
8-
gunicorn
8+
gunicorn=20.1.0
99
nltk

webapp/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"scripts": {
66
"serve": "vue-cli-service serve",
77
"build": "vue-cli-service build",
8-
"lint": "vue-cli-service lint"
8+
"lint": "vue-cli-service lint",
9+
"postinstall": "npm run build"
910
},
1011
"dependencies": {
1112
"axios": "^1.7.2",

webapp/src/static.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"root": "dist",
3+
"clean_urls": true,
4+
"routes": {
5+
"/**": "index.html"
6+
}
7+
}

0 commit comments

Comments
 (0)