akvo / akvo-provisioning

Server and development environment provisioning data and configurations
9 stars 2 forks source link

Deployment of Akvo Dash prototype using Docker #271

Closed iperdomo closed 8 years ago

iperdomo commented 8 years ago

We want to use Docker to deploy the current (prototype) version of Akvo Dash.

There are 2 parts:

The backend needs access to a PostgreSQL 9.4 service

iperdomo commented 8 years ago

@orifito in the proxy container we need to serve always index.html so the / location looks like this:

location / {
  root   /usr/share/nginx/html;
  try_files $uri $uri/ /index.html;
}

This is because the SPA uses some special routing that doesn't exist physically, e.g.:

http://host/library
http://host/datasets
http://host/visualisations

All those URLs are index.html behind the scenes.

orifito commented 8 years ago

@iperdomo cool, thanks for testing that!

iperdomo commented 8 years ago

@orifito i found a solution to my problem of not fiding a Procfile... it was the WORKDIR directive.

diff --git a/docker/dash/proxy/Dockerfile b/docker/dash/proxy/Dockerfile
index 1e6bba6..e2b4a52 100644
--- a/docker/dash/proxy/Dockerfile
+++ b/docker/dash/proxy/Dockerfile
@@ -7,9 +7,8 @@ RUN apt-get update && \
     apt-get clean && \
     rm -rf /var/lib/apt/lists/*

-WORKDIR /tmp
-
-RUN git clone https://github.com/akvo/akvo-dash.git && \
+RUN cd /tmp && \
+    git clone https://github.com/akvo/akvo-dash.git && \
     cd akvo-dash/client && \
     npm set progress=false && \
     npm install && \
@@ -17,4 +16,4 @@ RUN git clone https://github.com/akvo/akvo-dash.git && \
     cp index.html /usr/share/nginx/html && \
     mkdir /usr/share/nginx/html/assets && \
     cp dist/* /usr/share/nginx/html/assets && \
-    cd /tmp && rm -rf akvo-dash
\ No newline at end of file
+    cd /tmp && rm -rf akvo-dash
orifito commented 8 years ago

@iperdomo great! I'll include that change :+1: