From 74c81c2a3751e4eb72b0fe40cfa0768149f3fbae Mon Sep 17 00:00:00 2001 From: icoxfog417 Date: Thu, 1 Aug 2019 12:10:16 +0900 Subject: [PATCH] Implement docker deployment from app.json --- .gitignore | 2 ++ Procfile | 1 - app.json | 11 ++--------- heroku.yml | 1 - tools/heroku.sh | 12 +----------- 5 files changed, 5 insertions(+), 22 deletions(-) delete mode 100644 Procfile diff --git a/.gitignore b/.gitignore index 9320c27a..8cc2c997 100644 --- a/.gitignore +++ b/.gitignore @@ -198,3 +198,5 @@ pip-selfcheck.json node_modules/ bundle/ webpack-stats.json + +.vscode/ diff --git a/Procfile b/Procfile deleted file mode 100644 index ac3a3657..00000000 --- a/Procfile +++ /dev/null @@ -1 +0,0 @@ -web: gunicorn --pythonpath app app.wsgi diff --git a/app.json b/app.json index 2278bf5a..db59ffbb 100644 --- a/app.json +++ b/app.json @@ -36,20 +36,13 @@ "value": "True" } }, + "stack": "container", "scripts": { - "postdeploy": "sh tools/heroku.sh deploy" + "postdeploy": "sh tools/heroku.sh" }, "addons": [ { "plan": "heroku-postgresql:hobby-dev" } - ], - "buildpacks": [ - { - "url": "heroku/nodejs" - }, - { - "url": "heroku/python" - } ] } diff --git a/heroku.yml b/heroku.yml index 3ed4e336..a28208b9 100644 --- a/heroku.yml +++ b/heroku.yml @@ -1,6 +1,5 @@ build: docker: web: Dockerfile - run: web: /doccano/tools/run.sh diff --git a/tools/heroku.sh b/tools/heroku.sh index 46da88d6..5d335f86 100644 --- a/tools/heroku.sh +++ b/tools/heroku.sh @@ -2,16 +2,6 @@ set -o errexit -if [ "$1" = "build" ]; then - cd app/server/static - npm install --only=prod - npm install --only=dev - ./node_modules/.bin/webpack --config ./webpack.config.js --mode production - echo "Done webpack build." - ls ./bundle -else - python app/manage.py migrate - python app/manage.py collectstatic --noinput +if [ -n "$ADMIN_USER_NAME" ]; then python app/manage.py create_admin --noinput --username="$ADMIN_USER_NAME" --email="$ADMIN_CONTACT_EMAIL" --password="$ADMIN_PASSWORD" - fi