From f47495850ea09cf398ed3f7749cbcd0e6f706fc0 Mon Sep 17 00:00:00 2001 From: Gregoire Parant Date: Wed, 30 Dec 2020 15:52:14 +0100 Subject: [PATCH] Add host name env variable --- .env.template | 1 + README.md | 12 +++++++++++- docker-compose.yaml | 29 ++++++++++++++--------------- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/.env.template b/.env.template index d0db42e3..20548aa7 100644 --- a/.env.template +++ b/.env.template @@ -5,3 +5,4 @@ JITSI_PRIVATE_MODE=false JITSI_ISS= SECRET_JITSI_KEY= ADMIN_API_TOKEN=123 +HOST_NAME=workadventure.localhost \ No newline at end of file diff --git a/README.md b/README.md index faafed98..a22e96a8 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,17 @@ triggered when you move next to a colleague). ## Getting started -Install Docker. +Install Docker : https://docs.docker.com/get-docker/ +Install docker-compose : https://docs.docker.com/compose/install/ + +**Add your local environment variable** +Run: + +``` +cp .en.template .env +``` +_``If you want deploy on the dev server, you must update HOST_NAME in your `.env` by your private domain (workadventure.localhost => yourdomain.com).`` +**_``Don't forgot to add A entry in DNS like this *.yourdomain.com. The different deployed for WorkAdventure are: play. ; pusher. ; maps. ; api. ; uploader. ;``_** Run: diff --git a/docker-compose.yaml b/docker-compose.yaml index 582ce142..fd83e25c 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -26,9 +26,8 @@ services: JITSI_PRIVATE_MODE: "$JITSI_PRIVATE_MODE" HOST: "0.0.0.0" NODE_ENV: development - API_URL: pusher.workadventure.localhost - UPLOADER_URL: uploader.workadventure.localhost - ADMIN_URL: admin.workadventure.localhost + API_URL: pusher.$HOST_NAME + UPLOADER_URL: uploader.$HOST_NAME STARTUP_COMMAND_1: yarn install TURN_SERVER: "turn:coturn.workadventu.re:443,turns:coturn.workadventu.re:443" TURN_USER: workadventure @@ -37,10 +36,10 @@ services: volumes: - ./front:/usr/src/app labels: - - "traefik.http.routers.front.rule=Host(`play.workadventure.localhost`)" + - "traefik.http.routers.front.rule=Host(`play.$HOST_NAME`)" - "traefik.http.routers.front.entryPoints=web,traefik" - "traefik.http.services.front.loadbalancer.server.port=8080" - - "traefik.http.routers.front-ssl.rule=Host(`play.workadventure.localhost`)" + - "traefik.http.routers.front-ssl.rule=Host(`play.$HOST_NAME`)" - "traefik.http.routers.front-ssl.entryPoints=websecure" - "traefik.http.routers.front-ssl.tls=true" - "traefik.http.routers.front-ssl.service=front" @@ -62,10 +61,10 @@ services: volumes: - ./pusher:/usr/src/app labels: - - "traefik.http.routers.pusher.rule=Host(`pusher.workadventure.localhost`)" + - "traefik.http.routers.pusher.rule=Host(`pusher.$HOST_NAME`)" - "traefik.http.routers.pusher.entryPoints=web" - "traefik.http.services.pusher.loadbalancer.server.port=8080" - - "traefik.http.routers.pusher-ssl.rule=Host(`pusher.workadventure.localhost`)" + - "traefik.http.routers.pusher-ssl.rule=Host(`pusher.$HOST_NAME`)" - "traefik.http.routers.pusher-ssl.entryPoints=websecure" - "traefik.http.routers.pusher-ssl.tls=true" - "traefik.http.routers.pusher-ssl.service=pusher" @@ -85,10 +84,10 @@ services: volumes: - ./maps:/var/www/html labels: - - "traefik.http.routers.maps.rule=Host(`maps.workadventure.localhost`)" + - "traefik.http.routers.maps.rule=Host(`maps.$HOST_NAME`)" - "traefik.http.routers.maps.entryPoints=web,traefik" - "traefik.http.services.maps.loadbalancer.server.port=80" - - "traefik.http.routers.maps-ssl.rule=Host(`maps.workadventure.localhost`)" + - "traefik.http.routers.maps-ssl.rule=Host(`maps.$HOST_NAME`)" - "traefik.http.routers.maps-ssl.entryPoints=websecure" - "traefik.http.routers.maps-ssl.tls=true" - "traefik.http.routers.maps-ssl.service=maps" @@ -109,10 +108,10 @@ services: volumes: - ./back:/usr/src/app labels: - - "traefik.http.routers.back.rule=Host(`api.workadventure.localhost`)" + - "traefik.http.routers.back.rule=Host(`api.$HOST_NAME`)" - "traefik.http.routers.back.entryPoints=web" - "traefik.http.services.back.loadbalancer.server.port=8080" - - "traefik.http.routers.back-ssl.rule=Host(`api.workadventure.localhost`)" + - "traefik.http.routers.back-ssl.rule=Host(`api.$HOST_NAME`)" - "traefik.http.routers.back-ssl.entryPoints=websecure" - "traefik.http.routers.back-ssl.tls=true" - "traefik.http.routers.back-ssl.service=back" @@ -127,10 +126,10 @@ services: volumes: - ./uploader:/usr/src/app labels: - - "traefik.http.routers.uploader.rule=Host(`uploader.workadventure.localhost`)" + - "traefik.http.routers.uploader.rule=Host(`uploader.$HOST_NAME`)" - "traefik.http.routers.uploader.entryPoints=web" - "traefik.http.services.uploader.loadbalancer.server.port=8080" - - "traefik.http.routers.uploader-ssl.rule=Host(`uploader.workadventure.localhost`)" + - "traefik.http.routers.uploader-ssl.rule=Host(`uploader.$HOST_NAME`)" - "traefik.http.routers.uploader-ssl.entryPoints=websecure" - "traefik.http.routers.uploader-ssl.tls=true" - "traefik.http.routers.uploader-ssl.service=uploader" @@ -144,10 +143,10 @@ services: volumes: - ./website:/var/www/html labels: - - "traefik.http.routers.website.rule=Host(`workadventure.localhost`)" + - "traefik.http.routers.website.rule=Host(`$HOST_NAME`)" - "traefik.http.routers.website.entryPoints=web" - "traefik.http.services.website.loadbalancer.server.port=80" - - "traefik.http.routers.website-ssl.rule=Host(`workadventure.localhost`)" + - "traefik.http.routers.website-ssl.rule=Host(`$HOST_NAME`)" - "traefik.http.routers.website-ssl.entryPoints=websecure" - "traefik.http.routers.website-ssl.tls=true" - "traefik.http.routers.website-ssl.service=website"