Deployment
This part of the project is still in progress. We're working on it to make one click deployment.On VPS/Server
Dockerfile
The Dockerfile is already made with all the instructions.
GitHub Actions
GitHub Actions is already made with all the instructions for a VPS/Server deployment, inside the .github/workflows/main.yml
file.
This is just an example, you have to change some commands inside it if you want to use it like that.
.github/workflows/main.yml
ssh:
name: ssh
runs-on: ubuntu-latest
steps:
- name: SSH and run a remote command
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: |
cd turbosaas-site/
git pull
sudo docker build -t turbosaas .
cd
cd docker/turbosaas/
sudo docker-compose down
sudo docker-compose up -d
docker-compose
There is a simple example of the docker-compose file, I personally use it for my VPS/Server deployment. It creates a postgres database, a turbosaas documentation server, and a turbosaas server.
docker-compose.yml
version: '3.9'
services:
database:
container_name: database
image: postgres
restart: always
shm_size: 128mb
environment:
POSTGRES_PASSWORD: dev
POSTGRES_USER: dev
POSTGRES_DB: dev
ports:
- "5432:5432"
expose:
- "5432"
volumes:
- pgdata:/var/lib/postgresql/data
documentation:
container_name: documentation
image: turbosaas-doc
ports:
- "5005:3000"
turbosaas:
container_name: turbosaas
image: turbosaas
restart: always
ports:
- "5003:5003"
depends_on:
- database
environment:
TZ: UTC
PORT: 5003
HOST: 0.0.0.0
LOG_LEVEL: info
APP_KEY: todo
NODE_ENV: production
SESSION_DRIVER: cookie
DB_HOST: database
DB_PORT: 5432
DB_USER: dev
DB_PASSWORD: dev
DB_DATABASE: dev
STRIPE_SECRET_KEY: "todo"
SMTP_HOST: todo
SMTP_PORT: 465
SMTP_USERNAME: todo
SMTP_PASSWORD: "todo"
MAILGUN_API_KEY: todos
MAILGUN_SENDER: ""
MAILGUN_USERNAME: todos
DISCORD_CLIENT_ID: todos
DISCORD_CLIENT_SECRET: todos
FACEBOOK_CLIENT_ID: todos
FACEBOOK_CLIENT_SECRET: todos
GITHUB_CLIENT_ID: todos
GITHUB_CLIENT_SECRET: todos
GOOGLE_CLIENT_ID: todos
GOOGLE_CLIENT_SECRET: todos
LINKEDIN_CLIENT_ID: todos
LINKEDIN_CLIENT_SECRET: todos
SPOTIFY_CLIENT_ID: todos
SPOTIFY_CLIENT_SECRET: todos
TWITTER_CLIENT_ID: todos
TWITTER_CLIENT_SECRET: todos
BRAND_NAME: TurboSaaS
BRAND_EMAIL: [email protected]
volumes:
pgdata:
This script will pull the latest version of the repository, build the docker image, and run the docker container, automatically after each push.
Heroku
There is a guide made by AdonisJS for Heroku deployment, you can find it here (opens in a new tab).