Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dokku support #38

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft

Dokku support #38

wants to merge 8 commits into from

Conversation

abulte
Copy link
Contributor

@abulte abulte commented Dec 14, 2019

POC pour voir ce que peut donner l'hébergement (avec du souverain dedans 🇫🇷) d'un site statique sur une instance auto-hébergée de Dokku.

http://guides.dokku.gouv.studio

@abulte
Copy link
Contributor Author

abulte commented Dec 14, 2019

Deploy app

$ git push dokku dokku:master
Total 0 (delta 0), réutilisés 0 (delta 0)
-----> Cleaning up...
-----> Building guides from herokuish...
-----> Adding BUILD_ENV to build environment...
-----> Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
       Detected buildpacks: multi nodejs
-----> Multipack app detected
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git
=====> Detected Framework: Node.js

-----> Creating runtime environment

       NPM_CONFIG_LOGLEVEL=error
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       NODE_VERBOSE=false

-----> Installing binaries
       engines.node (package.json):  unspecified
       engines.npm (package.json):   unspecified (use default)

       Resolving node version 12.x...
       Downloading and installing node 12.13.1...
       Using default npm version: 6.12.1

-----> Restoring cache
       Cached directories were not restored due to a change in version of node, npm, yarn or stack
       Module installation may take longer for this build

-----> Installing dependencies
       Installing node modules (package.json + package-lock)

       > [email protected] postinstall /tmp/build/node_modules/core-js
       > node scripts/postinstall || echo "ignore"


       > [email protected] postinstall /tmp/build/node_modules/vuepress
       > opencollective-postinstall || true

       added 1212 packages from 581 contributors and audited 19800 packages in 42.425s
       found 3 moderate severity vulnerabilities
       run `npm audit fix` to fix them, or `npm audit` for details

-----> Build
       Running build

       > [email protected] build /tmp/build
       > vuepress build

       wait Extracting site metadata...
       tip Apply theme vuepress-theme-gouv-fr (extends @vuepress/theme-default) ...
       tip Apply plugin container (i.e. "vuepress-plugin-container") ...
       tip Apply plugin @vuepress/register-components (i.e. "@vuepress/plugin-register-components") ...
       tip Apply plugin @vuepress/active-header-links (i.e. "@vuepress/plugin-active-header-links") ...
       tip Apply plugin @vuepress/search (i.e. "@vuepress/plugin-search") ...
       tip Apply plugin @vuepress/nprogress (i.e. "@vuepress/plugin-nprogress") ...
       tip Apply plugin matomo (i.e. "vuepress-plugin-matomo") ...
remote: warning Override existing page /.
       ℹ Compiling Client
       ℹ Compiling Server
       ✔ Server: Compiled successfully in 13.33s
       ✔ Client: Compiled successfully in 22.99s
       wait Rendering static HTML...
success Generated static files in public.


-----> Pruning devDependencies
       audited 19800 packages in 12.66s
       found 3 moderate severity vulnerabilities
       run `npm audit fix` to fix them, or `npm audit` for details

-----> Caching build
       - node_modules

-----> Build succeeded!
       !     This app may not specify any way to start a node process
       https://devcenter.heroku.com/articles/nodejs-support#default-web-process-type

=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-static.git
=====> Detected Framework: Static HTML
remote:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
remote:                                  Dload  Upload   Total   Spent    Left  Speed
remote: 100  838k  100  838k    0     0  1037k      0 --:--:-- --:--:-- --:--:-- 1036k
-----> Installed directory to /app/bin
       Using release configuration from last framework (Static HTML).
-----> Discovering process types
       Default types for  -> web
-----> Releasing guides (dokku/guides:latest)...
-----> Deploying guides (dokku/guides:latest)...
-----> App Procfile file found (/home/dokku/guides/DOKKU_PROCFILE)
       DOKKU_SCALE declares scale -> web=1
=====> Processing deployment checks
       No CHECKS file found. Simple container checks will be performed.
       For more efficient zero downtime deployments, create a CHECKS file. See http://dokku.viewdocs.io/dokku/deployment/zero-downtime-deploys/ for examples
-----> Attempting pre-flight checks (web.1)
       Waiting for 10 seconds ...
       Default container check successful!
-----> Running post-deploy
-----> Creating new /home/dokku/guides/VHOST...
-----> Configuring guides.dokku.gouv.studio...(using built-in template)
-----> Creating http nginx.conf
       Reloading nginx
-----> Renaming containers
       Renaming container (f76dd288b4ca) wonderful_elgamal to guides.web.1
=====> Application deployed:
       http://guides.dokku.gouv.studio

To dokku.gouv.studio:guides
 * [new branch]      dokku -> master

@abulte
Copy link
Contributor Author

abulte commented Dec 15, 2019

Add SSL support

Get certificate

$ dokku letsencrypt
=====> Let's Encrypt guides
-----> Updating letsencrypt docker image...
0.1.0: Pulling from dokku/letsencrypt
Digest: sha256:af5f8529c407645e97821ad28eba328f4c59b83b2141334f899303c49fc07823
Status: Image is up to date for dokku/letsencrypt:0.1.0
docker.io/dokku/letsencrypt:0.1.0
       Done updating
-----> Enabling ACME proxy for guides...
[ ok ] Reloading nginx configuration (via systemctl): nginx.service.
-----> Getting letsencrypt certificate for guides...
        - Domain 'guides.dokku.gouv.studio'
darkhttpd/1.12, copyright (c) 2003-2016 Emil Mikulic.
listening on: http://0.0.0.0:80/
2019-12-15 09:03:28,193:INFO:__main__:1317: Generating new account key
2019-12-15 09:03:30,787:INFO:__main__:1343: By using simp_le, you implicitly agree to the CA's terms of service: https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf
2019-12-15 09:03:31,113:INFO:__main__:1406: Generating new certificate private key
2019-12-15 09:03:34,935:INFO:__main__:396: Saving account_key.json
2019-12-15 09:03:34,936:INFO:__main__:396: Saving account_reg.json
2019-12-15 09:03:34,937:INFO:__main__:396: Saving fullchain.pem
2019-12-15 09:03:34,938:INFO:__main__:396: Saving chain.pem
2019-12-15 09:03:34,939:INFO:__main__:396: Saving cert.pem
2019-12-15 09:03:34,940:INFO:__main__:396: Saving key.pem
-----> Certificate retrieved successfully.
-----> Installing let's encrypt certificates
-----> Configuring guides.dokku.gouv.studio...(using built-in template)
-----> Creating https nginx.conf
       Reloading nginx
-----> Configuring guides.dokku.gouv.studio...(using built-in template)
-----> Creating https nginx.conf
       Reloading nginx
-----> Disabling ACME proxy for guides...
[ ok ] Reloading nginx configuration (via systemctl): nginx.service.
       done

Restart app to enable auto-redirect to https

dokku ps:restart
-----> Releasing guides (dokku/guides:latest)...
-----> Deploying guides (dokku/guides:latest)...
-----> App Procfile file found (/home/dokku/guides/DOKKU_PROCFILE)
       DOKKU_SCALE declares scale -> web=1
=====> Processing deployment checks
       No CHECKS file found. Simple container checks will be performed.
       For more efficient zero downtime deployments, create a CHECKS file. See http://dokku.viewdocs.io/dokku/deployment/zero-downtime-deploys/ for examples
-----> Attempting pre-flight checks (web.1)
       Waiting for 10 seconds ...
       Default container check successful!
-----> Running post-deploy
-----> Configuring guides.dokku.gouv.studio...(using built-in template)
-----> Creating https nginx.conf
       Reloading nginx
-----> Renaming containers
       Found previous container(s) (f76dd288b4ca) named guides.web.1
       Renaming container (f76dd288b4ca) guides.web.1 to guides.web.1.1576400828
       Renaming container (e33bd45c2b6b) fervent_taussig to guides.web.1
-----> Shutting down old containers in 60 seconds
       f76dd288b4ca837ae793847022170ef4417a4e9dc61de34241d5c9cd41f14ba7
=====> Application deployed:
       http://guides.dokku.gouv.studio
       https://guides.dokku.gouv.studio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant