Open BettyNutz opened 7 months ago
Here is a quick example of how I do it:
➜ /static_sites cat docker-compose.yml
version: "3.3"
services:
example.org:
image: docker.io/joseluisq/static-web-server:2
container_name: "example.org"
environment:
# Note: those envs are customizable but also optional
- SERVER_PORT=8080
- SERVER_ROOT=/public
- SERVER_LOG_LEVEL=info
volumes:
- /static_sites/static-calendar-cje/example.org:/public
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.static-calendar-cje.rule=Host(`example.org`)"
- "traefik.http.routers.static-calendar-cje.service=static-calendar-cje-service"
- "traefik.http.routers.static-calendar-cje.entrypoints=web-secure"
- "traefik.http.routers.static-calendar-cje.tls=true"
- "traefik.http.routers.static-calendar-cje.tls.certResolver=default"
- "traefik.http.services.static-calendar-cje-service.loadbalancer.server.port=8080"
networks:
- traefik
This is an example for a static site but you could do this for any container.
If you are interested in static sites you might want to check out my ansible playbook to set them up easily: https://git.hyteck.de/moanos/ansible-playbook-static-site-host.git
@BettyNutz Did this answer your question ?
I had to struggle also to get my other services running (old owncloud, gitlab, etherpad, odoo) and find the right set of labels to get it right.
Maybe a PR for adding a section in documentation would be nice... @spantaleev @moan0s @aine-etke ?
I've set up a server using this playbook. Its running a few services (eg synthing) that ive chosen by adding to vars file and they all working behind traefik. Great. but im struggling to run other docker containers using the traefik thats installed.
I understand the doc to config the dns for eg syncthing - id go to https://mash.example.com/syncthing and it get the synthign UI. Great
But how do i get my website to be on the main domain https://example.com/ and have it running behind traefik?
Not sure how to get it working - new to Ansible with a few playbooks under my belt but this one is way more complicated
this is what id use to get the PrestaShop working usually: