From 2561d9d1145d1b7ac82bda79ff384d49b80495a8 Mon Sep 17 00:00:00 2001
From: Eliot Berriot <contact@eliotberriot.com>
Date: Wed, 13 Mar 2019 10:20:57 +0100
Subject: [PATCH] Fix port binding issues in dev

---
 CONTRIBUTING.rst | 3 ++-
 dev.yml          | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index e561a8314d..8196243381 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -280,7 +280,8 @@ When working on federation with traefik, ensure you have this in your ``env``::
     EXTERNAL_REQUESTS_VERIFY_SSL=false
     # this ensure you don't have incorrect urls pointing to http resources
     FUNKWHALE_PROTOCOL=https
-
+    # Disable host ports binding for the nginx container, as traefik is serving everything
+    NGINX_PORTS_MAPPING=80
 
 Typical workflow for a contribution
 -----------------------------------
diff --git a/dev.yml b/dev.yml
index 2b1e7c5fee..7c61e78ea0 100644
--- a/dev.yml
+++ b/dev.yml
@@ -60,6 +60,8 @@ services:
       - "FUNKWHALE_PROTOCOL=${FUNKWHALE_PROTOCOL-http}"
       - "DATABASE_URL=postgresql://postgres@postgres/postgres"
       - "CACHE_URL=redis://redis:6379/0"
+      - "FUNKWHALE_SPA_HTML_ROOT=http://nginx/front/"
+
     links:
       - postgres
       - redis
@@ -95,6 +97,8 @@ services:
       - .env.dev
       - .env
     image: nginx
+    ports:
+      - "${NGINX_PORTS_MAPPING-8000:80}"
     environment:
       - "NGINX_MAX_BODY_SIZE=${NGINX_MAX_BODY_SIZE-100M}"
       - "FUNKWHALE_API_IP=${FUNKHALE_API_IP-api}"
-- 
GitLab