- Couper tout service sur le port 80 (Nginx, Apache, traefik...)
- Ajouter la ligne
127.0.0.1 data.localhost traefik.data.localhost v1.data.localhost v2.data.localhost
à votre/etc/hosts
docker-compose up
dans le répertoire
-
-
Save noirbizarre/cce0a7038181de17d3d263b3e2e08a61 to your computer and use it in GitHub Desktop.
Dual stack udata demo (Python 2/Python 3)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DOMAIN=data.localhost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
volumes: | |
udata-fs: | |
udata-static: | |
mongo-data: | |
redis-data: | |
elasticsearch-data: | |
services: | |
traefik: | |
image: traefik:latest | |
container_name: traefik | |
command: --web --logLevel=DEBUG | |
ports: | |
- "80:80" | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock:ro | |
- ./traefik.yml:/etc/traefik/traefik.yml | |
- ./udata.yml:/etc/traefik/udata.yml | |
labels: | |
traefik.http.routers.traefik.rule: Host(`traefik.${DOMAIN}`) | |
traefik.http.services.traefik.loadbalancer.server.port: "8080" | |
db: | |
image: mongo:3.6 | |
container_name: udata-db | |
command: mongod | |
volumes: | |
- mongo-data:/data/db | |
ports: | |
- "27017:27017" | |
labels: | |
traefik.tcp.routers.udata-db.rule: HostSNI(`db.${DOMAIN}`) | |
traefik.tcp.services.udata-db.loadbalancer.server.port: "27017" | |
redis: | |
image: redis | |
container_name: udata-redis | |
volumes: | |
- redis-data:/data | |
ports: | |
- "6379:6379" | |
elasticsearch: | |
image: udata/elasticsearch | |
container_name: udata-es | |
volumes: | |
- elasticsearch-data:/usr/share/elasticsearch/data | |
labels: | |
traefik.http.routers.udata-es.rule: Host(`es.${DOMAIN}`) | |
traefik.http.services.udata-es.loadbalancer.server.port: "9200" | |
udata-front-v1: | |
image: udata/udata:celery-compat | |
container_name: udata-front-v1 | |
command: front | |
links: | |
- mongodb:mongodb | |
- redis:redis | |
- elasticsearch:elasticsearch | |
volumes: | |
- udata-fs:/udata/fs | |
- ./udata.cfg:/udata/udata.cfg | |
labels: | |
traefik.http.routers.udata-front-v1.rule: Host(`v1.${DOMAIN}`) | |
traefik.http.services.udata-front-v1.loadbalancer.server.port: "7000" | |
udata-front-v2: | |
image: udata/udata:2-celery-compat | |
container_name: udata-front-v2 | |
command: front | |
links: | |
- mongodb:mongodb | |
- redis:redis | |
- elasticsearch:elasticsearch | |
volumes: | |
- udata-fs:/udata/fs | |
- ./udata.cfg:/udata/udata.cfg | |
labels: | |
traefik.http.routers.udata-front-v2.rule: Host(`v2.${DOMAIN}`) | |
traefik.http.services.udata-front-v2.loadbalancer.server.port: "7000" | |
udata-beat: | |
image: udata/udata:celery-compat | |
command: beat | |
container_name: udata-beat | |
links: | |
- mongodb:mongodb | |
- redis:redis | |
- elasticsearch:elasticsearch | |
volumes: | |
- udata-fs:/udata/fs | |
udata-worker-v1: | |
image: udata/udata:celery-compat | |
container_name: udata-worker-v1 | |
command: worker | |
links: | |
- mongodb:mongodb | |
- redis:redis | |
- elasticsearch:elasticsearch | |
volumes: | |
- udata-fs:/udata/fs | |
- ./udata.cfg:/udata/udata.cfg | |
udata-worker-v2: | |
image: udata/udata:2-celery-compat | |
container_name: udata-worker-v2 | |
command: worker | |
links: | |
- mongodb:mongodb | |
- redis:redis | |
- elasticsearch:elasticsearch | |
volumes: | |
- udata-fs:/udata/fs | |
- ./udata.cfg:/udata/udata.cfg | |
udata: | |
image: udata/udata:celery-compat | |
command: collect -ni /static/public | |
links: | |
- mongodb:mongodb | |
- redis:redis | |
- elasticsearch:elasticsearch | |
volumes: | |
- udata-fs:/udata/fs | |
- udata-static:/static | |
- ./udata.cfg:/udata/udata.cfg | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
providers: | |
docker: {} | |
file: | |
filename: /etc/traefik/udata.yml | |
watch: true | |
# API and dashboard configuration | |
api: | |
insecure: true | |
entryPoints: | |
http: | |
address: ":80" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
DEBUG = True | |
SERVER_NAME = 'data.localhost' | |
MONGODB_HOST = 'mongodb://mongodb:27017/udata' | |
ELASTICSEARCH_URL = 'elasticsearch:9200' | |
CACHE_TYPE = 'redis' | |
CACHE_REDIS_URL = 'redis://redis:6379/1' | |
CELERY_BROKER_URL = 'redis://redis:6379' | |
CELERY_RESULT_BACKEND = 'redis://redis:6379' | |
THEME = 'gouvfr' | |
PLUGINS = ['gouvfr'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http: | |
routers: | |
udata: | |
rule: Host(`data.localhost`) | |
service: udata | |
services: | |
udata: | |
loadBalancer: | |
sticky: | |
cookie: {} | |
servers: | |
- url: http://v1.data.localhost/ | |
- url: http://v2.data.localhost/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment