Giter Site home page Giter Site logo

Comments (4)

ss-o avatar ss-o commented on May 23, 2024

Solution might be to assign internal domain for docker hosts and point your example.com as CNAME.

In most cases 'ROOT_DOMAIN' used with 'SRV records'. As your swarm instance able to have multiple hosts inside, subdomain represents those hosts for service discovery.

Example:

_service._proto.name. TTL class SRV priority weight port target.

_sip._tcp.example.com. 86400 IN SRV 10 60 5060 bigbox.example.com.
_sip._tcp.example.com. 86400 IN SRV 10 20 5060 smallbox1.example.com.
_sip._tcp.example.com. 86400 IN SRV 10 20 5060 smallbox2.example.com.
_sip._tcp.example.com. 86400 IN SRV 20 0 5060 backupbox.example.com.

It's used to describe WHAT service and WHERE to deploy.
https://en.wikipedia.org/wiki/SRV_record

from swarmlet.

rvenugopal avatar rvenugopal commented on May 23, 2024

@ss-o Is CNAME really the expected solution? Wouldn't that be a security risk?

On digitial ocean, I added a CNAME for
www.example.com is an alias of static.example.com

That didn't work

from swarmlet.

ss-o avatar ss-o commented on May 23, 2024

I assume I miss understood. Probably you want to deploy app lika a nginx proxy manager to reverse proxy. Have you tried? If no I can refer for more detail. Reverse proxy in my opinion is most secure and easiest way to manage domains/ips/ports if setup correctly.

from swarmlet.

rvenugopal avatar rvenugopal commented on May 23, 2024

@ss-o Thanks for responding. I don't know much about devops but what I am trying to do is have multiple websites on my VPS where each site can be of the following structure

https:\\www.example.com or https:\\example.com # home page
https:\\www.example.com\app # this is where my app will exist
https:\\blog.example.com # for my blog

I understand each of these (home / app / blog) have to be its own app and deployed separately using traefik but I am having trouble getting the rules to work. For e.g. I have in my docker-compose.yml

- 'traefik.http.routers.frontend.rule=Host(`${DOMAIN}`) || Host(`www.${DOMAIN}`)'

but this accepts www.example.com but not example.com.

PS : I am playing with the https://github.com/swarmlet/swarmlet/blob/master/examples/static-site/docker-compose.yml#L17. I know there is an accompanying nginx.conf file but how will that work with the fact that the domain can be configured in the .env file and fed into the docker-compose.yml for the frontend rule

from swarmlet.

Related Issues (20)

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.