Skip to content

ninech/deploio-examples

Repository files navigation

deploio-examples

This repository hosts example apps for different languages and frameworks that are being supported by Deploio. Please also check out our language specific documentation for more details.

Go

nctl create application go \
  --git-url=https://github.com/ninech/deploio-examples \
  --git-sub-path=go

Ruby

This requires the rails command to be installed for the SECRET_KEY_BASE. If you don't have it, any long random string will do (127+ chars).

nctl create application rails \
  --git-url=https://github.com/ninech/deploio-examples \
  --git-sub-path=ruby/rails-basic \
  --env=SECRET_KEY_BASE=$(rails secret)

Node.js

nctl create application nextjs \
  --git-url=https://github.com/ninech/deploio-examples \
  --git-sub-path=nodejs/nextjs \
  --build-env=NODE_ENV="production" \
  --env=NODE_ENV="production"

PHP

nctl create application symfony \
  --git-url=https://github.com/ninech/deploio-examples \
  --git-sub-path=php/symfony

Python

The example provides a Django application which shows a random message on every page reload. It uses a temporary local sqlite database. Please note that the database will be recreated on every deployment or restart of the application (all data will be lost), so it really just is useful for demonstration purposes. For persistent data, please use a postgres or mysql external database. The Django admin interface can be used to add messages. Just visit https://<URL of app>/admin to access it and use the user credentials which you pass via the env variables below to login. Please also define the SECRET_KEY which is used to secure signed data and should be kept secret.

nctl create application django-example \
  --git-url=https://github.com/ninech/deploio-examples \
  --git-sub-path=python/django \
  --env=DJANGO_SU_NAME=admin \
  [email protected] \
  --env=DJANGO_SU_PASSWORD=<INSERT A PASSWORD HERE> \
  --env=SECRET_KEY=<VERY LONG RANDOM SECRET KEY>

Static

For static sites we have two examples:

  • just a plain index.html

    nctl create application static-html \
      --git-url=https://github.com/ninech/deploio-examples \
      --git-sub-path=static/html
  • a frontend react app built with npm

    nctl create application static-react \
      --git-url=https://github.com/ninech/deploio-examples \
      --git-sub-path=static/react

Dockerfile

With Dockerfile builds, Deploio can build any app that can be built using a Dockerfile. To demonstrate this we have the following sample apps:

  • a very basic Rust app:

    nctl create application dockerfile-rust \
    --git-url=https://github.com/ninech/deploio-examples \
    --git-sub-path=dockerfile/rust \
    --dockerfile