Giter Site home page Giter Site logo

riggraz / saas-custom-domains Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sireto/custom-domain

0.0 1.0 0.0 39 KB

Custom domain support for your SaaS software with Caddy (forked from sireto/custom-domain)

License: Apache License 2.0

Shell 0.52% Python 95.79% Dockerfile 3.68%

saas-custom-domains's Introduction

Custom Domain API

This service is designed to support custom domains for SaaS products.

It is a fork from the original project by Sireto that basically just updates Python to 3.11

Usage

Here are the steps you need to take to run this docker image.

1. Environment variables

Set the proper environment variable for your desired installation.

Here is a sample .env file.

SAAS_UPSTREAM=example.com:443
API_KEY=0df05a6c-d4c6-4ee4-a55d-de1409e82cee

2. Create docker volumes to persist data (eg. certificates, domains etc.)

docker volume create https_data
docker volume create https_domains

3. Docker Compose file

Create a docker-compose.yml file.

version: "3.7"

services:
  https:
    image: riggraz/saas-custom-domains:latest
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
      - "9000:9000"
    restart: unless-stopped
    networks:
      - frontend
    env_file:
      - .env
    volumes:
      - https_domains:/app/domains
      - https_data:/root/.local/share

volumes:
  https_data:
    external: true
  https_domains:
    external: true

networks:
  frontend:

Now you can run the compose file:

docker-compose up -d

This will run a webserver and the management APIs.

The OpenAPI docs for the management APIs will be available on port 9000.
So, if you deployed host is localhost, the APIs are available at:
http://localhost:9000/docs

4. Instructions for SaaS customers

Your SaaS customers need to add a DNS Record to point their domain to your deployed server. This can be done in one of the two ways.

4.1 A Record

Assuming your deployed server has IP address: XX.XX.XX.XX.
Then your customers will have to set the DNS Record:

  • Type: A Record
  • Name: customerdomain.com (or subdomain)
  • IPv4 address: XX.XX.XX.XX

4.2 CNAME Record

Assuming your deployed server has a DNS name: custom.example.com
Then, your customer should set the following DNS records:

  • Type: CNAME Record
  • Name: customerdomain.com (or subdomain)
  • Target: custom.example.com

saas-custom-domains's People

Contributors

spannercode avatar riggraz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.