Skip to content

devs-group/sloth

Repository files navigation

Sloth 🦥

Overview

Sloth is an open-source platform that simplifies container application deployment. Users can configure and deploy containers through an intuitive web interface. The platform is designed for extensibility and customization, working on any server or computer.


Features 🚀

  • Web Interface: User-friendly dashboard for managing container applications.
  • Container Deployment: Support for container specifications, including ports, URLs, and persistent storage.
  • Automated Routing: Integrated reverse proxy with Traefik.
  • Cross-Platform Deployment: Compatible with various system architectures.
  • Security: OAuth2 authentication with GitHub and Google login.

Tech Stack 🛠️

  • Backend: Golang
  • Container Technology: Docker Compose, Traefik
  • Frontend: Nuxt.js
  • Database: SQLite

Installation 💻

Configuration

  1. Copy the .env.example into the same directory and name it .env

Requirements

  • Golang (1.23.3 and higher):
    • For using Goose: brew install go
  • Goose (3.18.0 and higher):
    • go install github.com/pressly/goose/v3/cmd/goose@v3.18.0
  • Docker (27.4.0 and higher):

Docker mounts

Docker in Docker is a special topic and we figured it might make sense to define /var/app as the work directory for all the services so we can be sure that we can mount these also on hosts using Mac (We are not counting in Windows at this time). /var/folder is already implemented in Docker Desktop as a known virtual mount. This is explicitly documented here.

Steps

  1. Clone the repository:
    git clone https://github.com/devs-group/sloth.git
    cd sloth
  2. Create a network called traefik on your local machine with: docker network create traefik
  3. Start everything by running:
    docker compose up -d
    
    A build process will start on the first time, you can also trigger it by running: docker compose build

Local Endpoints


Migrations ⚙️

Make sure you have goose installed. Project-related migrations can be found in migrations

  • Create Migration: make goose-static-create <type_of_creation>_<name_of_migration> (eg. create_table_my_table)

We run auto migrations on each app start. Since "air" will restart the app on any changes the migrations will apply automatically, but it might be helpful sometimes to rollback and reapply.

  • Check out the Makefile for possible commands

Deployment

We use Docker in Docker in production so make sure to mount your servers docker.sock into the container to test it

Preparations

  1. Make sure you have installed Docker (We recommend Docker Engine) on your server
  2. Create a network called traefik on your server with: docker network create traefik
  3. Run Traefik on your server via Docker (TODO: Add default traefik config and explain steps for setup)
  4. Test your build locally by running docker build -f ./deployment/Dockerfile -t sloth/app:latest . in the root directory
    • Make sure to change RUN npm run generate:prod to RUN npm run generate temporarily in the release.yml otherwise you will be redirected to the production page
  5. Then you can run: docker run -t -i --env-file .env -v /var/run/docker.sock:/var/run/docker.sock -p 9090:9090 --rm sloth/app:latest

TODO: Explain how to deploy Sloth


Tests

Make sure you are in the root directory

  1. You can run all tests with docker compose run backend go test ./... locally
    • The .env.test file can be used to define settings during tests

Contributing 🤝

Contributions are welcome! Please submit a pull request or create an issue on the GitHub repository.

Enjoy using Sloth! 🦥

About

Easiest container deployments out there

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •