From 2a4bf6b0c82165fc3727c22fc73622452e9b572a Mon Sep 17 00:00:00 2001 From: Henning Jacobs Date: Wed, 21 Dec 2016 22:55:15 +0100 Subject: [PATCH] fix Docker image: separate static assets from build output --- .gitignore | 2 +- Dockerfile | 1 + app.py | 2 +- app/package.json | 2 +- templates/index.html | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index cf5f64f..a98e69f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,5 @@ __pycache__ *.pyc .idea/ **/node_modules/ -static/ +static/build/ *-secret diff --git a/Dockerfile b/Dockerfile index da3cba7..84113ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,7 @@ RUN pip3 install -r /requirements.txt COPY app.py / COPY templates /templates COPY app /app +COPY static /static WORKDIR /app RUN npm install && npm run build diff --git a/app.py b/app.py index 948407f..beec72b 100755 --- a/app.py +++ b/app.py @@ -91,7 +91,7 @@ def health(): @authorize def index(): app_js = None - for entry in os.listdir('static'): + for entry in os.listdir('static/build'): if entry.startswith('app'): app_js = entry break diff --git a/app/package.json b/app/package.json index 795f788..f15bfff 100644 --- a/app/package.json +++ b/app/package.json @@ -4,7 +4,7 @@ "description": "=========================== Kubernetes Operational View ===========================", "main": "src/app.js", "config": { - "buildDir": "../static" + "buildDir": "../static/build" }, "scripts": { "prestart": "npm install", diff --git a/templates/index.html b/templates/index.html index 3143838..04190db 100644 --- a/templates/index.html +++ b/templates/index.html @@ -20,7 +20,7 @@
Loading..
- +