Browse Source
Merge pull request #101 from icoxfog417/heroku_button
Implement Heroku Button
pull/102/head
Hiroki Nakayama
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with
81 additions and
1 deletions
-
Procfile
-
README.md
-
app.json
-
package.json
-
tools/heroku.sh
|
@ -0,0 +1 @@ |
|
|
|
|
|
web: gunicorn --pythonpath app app.wsgi |
|
@ -37,7 +37,11 @@ Doccano can be deployed to Azure ([Web App for Containers](https://azure.microso |
|
|
|
|
|
|
|
|
### Heroku |
|
|
### Heroku |
|
|
|
|
|
|
|
|
Doccano can be deployed to [Heroku](https://www.heroku.com/) by following these steps: |
|
|
|
|
|
|
|
|
Doccano can be deployed to [Heroku](https://www.heroku.com/) by clicking on the button below: |
|
|
|
|
|
|
|
|
|
|
|
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) |
|
|
|
|
|
|
|
|
|
|
|
Of course, you can deploy doccano by using [heroku-cli](https://devcenter.heroku.com/articles/heroku-cli). |
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
heroku create |
|
|
heroku create |
|
|
|
@ -0,0 +1,50 @@ |
|
|
|
|
|
{ |
|
|
|
|
|
"name": "doccano", |
|
|
|
|
|
"description": "Open source text annotation tool for machine learning practitioner.", |
|
|
|
|
|
"keywords": ["Python", "Machine Learning", "Annotation"], |
|
|
|
|
|
"website": "https://doccano.herokuapp.com/", |
|
|
|
|
|
"repository": "https://github.com/chakki-works/doccano", |
|
|
|
|
|
"logo": "https://github.com/chakki-works/doccano/wiki/images/doccano.png", |
|
|
|
|
|
"success_url": "/", |
|
|
|
|
|
"env": { |
|
|
|
|
|
"ADMIN_USER_NAME": { |
|
|
|
|
|
"description": "The user name for the admin account." |
|
|
|
|
|
}, |
|
|
|
|
|
"ADMIN_CONTACT_EMAIL": { |
|
|
|
|
|
"description": "The contact email address for the admin account." |
|
|
|
|
|
}, |
|
|
|
|
|
"ADMIN_PASSWORD": { |
|
|
|
|
|
"description": "The password for the admin account." |
|
|
|
|
|
}, |
|
|
|
|
|
"SECRET_KEY": { |
|
|
|
|
|
"description": "The value to use as the Django secret key.", |
|
|
|
|
|
"generator": "secret" |
|
|
|
|
|
}, |
|
|
|
|
|
"GOOGLE_TRACKING_ID": { |
|
|
|
|
|
"description": "Google Analytics tracking id.", |
|
|
|
|
|
"required": false, |
|
|
|
|
|
"value": "" |
|
|
|
|
|
}, |
|
|
|
|
|
"DEBUG": { |
|
|
|
|
|
"description": "Debug mode or not.", |
|
|
|
|
|
"required": false, |
|
|
|
|
|
"value": "False" |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
"scripts": { |
|
|
|
|
|
"postdeploy": "sh tools/heroku.sh deploy" |
|
|
|
|
|
}, |
|
|
|
|
|
"addons": [ |
|
|
|
|
|
{ |
|
|
|
|
|
"plan": "heroku-postgresql:hobby-dev" |
|
|
|
|
|
} |
|
|
|
|
|
], |
|
|
|
|
|
"buildpacks": [ |
|
|
|
|
|
{ |
|
|
|
|
|
"url": "heroku/nodejs" |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
"url": "heroku/python" |
|
|
|
|
|
} |
|
|
|
|
|
] |
|
|
|
|
|
} |
|
@ -0,0 +1,8 @@ |
|
|
|
|
|
{ |
|
|
|
|
|
"engines": { |
|
|
|
|
|
"node": "8.x" |
|
|
|
|
|
}, |
|
|
|
|
|
"scripts": { |
|
|
|
|
|
"heroku-postbuild": "sh tools/heroku.sh build" |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
@ -0,0 +1,17 @@ |
|
|
|
|
|
#!/usr/bin/env bash |
|
|
|
|
|
|
|
|
|
|
|
set -o errexit |
|
|
|
|
|
|
|
|
|
|
|
if [ "$1" = "build" ]; then |
|
|
|
|
|
cd app/server |
|
|
|
|
|
npm install --only=prod |
|
|
|
|
|
npm install --only=dev |
|
|
|
|
|
./node_modules/.bin/webpack --config ./webpack.config.js --mode production |
|
|
|
|
|
echo "Done webpack build." |
|
|
|
|
|
ls ./static/bundle |
|
|
|
|
|
else |
|
|
|
|
|
python app/manage.py migrate |
|
|
|
|
|
python app/manage.py collectstatic --noinput |
|
|
|
|
|
python app/manage.py create_admin --noinput --username="$ADMIN_USER_NAME" --email="$ADMIN_CONTACT_EMAIL" --password="$ADMIN_PASSWORD" |
|
|
|
|
|
|
|
|
|
|
|
fi |