[docker] fix, Dockerfile for frontend builds (#9114)

* fix dockerfile for frontend builds

* fix paths

* empty commit for CI

* adjust version_info.json

* making version_info work

* rat

* fixing docker-compose node service

* address feedback
This commit is contained in:
David Aaron Suddjian
2020-02-12 07:48:24 -08:00
committed by GitHub
parent 30b7064e30
commit 966d321703
7 changed files with 9 additions and 6 deletions

4
.gitignore vendored
View File

@@ -61,8 +61,8 @@ npm-debug.log*
superset-frontend/coverage/* superset-frontend/coverage/*
superset-frontend/cypress/screenshots superset-frontend/cypress/screenshots
superset-frontend/cypress/videos superset-frontend/cypress/videos
superset-frontend/version_info.json superset/static/assets
superset/static superset/static/version_info.json
yarn-error.log yarn-error.log
# IntelliJ # IntelliJ

View File

@@ -1,5 +1,6 @@
.gitignore .gitignore
.gitattributes .gitattributes
.gitkeep
.coverage .coverage
.coveragerc .coveragerc
.codecov.yml .codecov.yml

View File

@@ -43,6 +43,7 @@ FROM node:10-jessie AS superset-node
# NPM ci first, as to NOT invalidate previous steps except for when package.json changes # NPM ci first, as to NOT invalidate previous steps except for when package.json changes
RUN mkdir -p /app/superset-frontend RUN mkdir -p /app/superset-frontend
RUN mkdir -p /app/superset/assets
COPY ./superset-frontend/package* /app/superset-frontend/ COPY ./superset-frontend/package* /app/superset-frontend/
RUN cd /app/superset-frontend \ RUN cd /app/superset-frontend \
&& npm ci && npm ci
@@ -81,6 +82,7 @@ RUN useradd --user-group --no-create-home --no-log-init --shell /bin/bash supers
COPY --from=superset-py /usr/local/lib/python3.6/site-packages/ /usr/local/lib/python3.6/site-packages/ COPY --from=superset-py /usr/local/lib/python3.6/site-packages/ /usr/local/lib/python3.6/site-packages/
# Copying site-packages doesn't move the CLIs, so let's copy them one by one # Copying site-packages doesn't move the CLIs, so let's copy them one by one
COPY --from=superset-py /usr/local/bin/gunicorn /usr/local/bin/celery /usr/local/bin/flask /usr/bin/ COPY --from=superset-py /usr/local/bin/gunicorn /usr/local/bin/celery /usr/local/bin/flask /usr/bin/
COPY --from=superset-node /app/superset/static/assets /app/superset/static/assets
COPY --from=superset-node /app/superset-frontend /app/superset-frontend COPY --from=superset-node /app/superset-frontend /app/superset-frontend
## Lastly, let's install superset itself ## Lastly, let's install superset itself

View File

@@ -26,6 +26,7 @@ x-superset-volumes: &superset-volumes
- ./docker/docker-init.sh:/app/docker-init.sh - ./docker/docker-init.sh:/app/docker-init.sh
- ./docker/pythonpath_dev:/app/pythonpath - ./docker/pythonpath_dev:/app/pythonpath
- ./superset:/app/superset - ./superset:/app/superset
- ./superset-frontend:/app/superset-frontend
- superset_home:/app/superset_home - superset_home:/app/superset_home
version: "3.7" version: "3.7"

View File

@@ -50,7 +50,7 @@ print("VERSION: " + version_string)
print("GIT SHA: " + GIT_SHA) print("GIT SHA: " + GIT_SHA)
print("-==-" * 15) print("-==-" * 15)
VERSION_INFO_FILE = os.path.join(BASE_DIR, "superset-frontend", "version_info.json") VERSION_INFO_FILE = os.path.join(BASE_DIR, "superset", "static", "version_info.json")
with open(VERSION_INFO_FILE, "w") as version_file: with open(VERSION_INFO_FILE, "w") as version_file:
json.dump(version_info, version_file) json.dump(version_info, version_file)

View File

@@ -57,9 +57,8 @@ else:
# --------------------------------------------------------- # ---------------------------------------------------------
# Superset specific config # Superset specific config
# --------------------------------------------------------- # ---------------------------------------------------------
PACKAGE_DIR = os.path.join(BASE_DIR, "static", "assets") VERSION_INFO_FILE = os.path.join(BASE_DIR, "static", "version_info.json")
VERSION_INFO_FILE = os.path.join(PACKAGE_DIR, "version_info.json") PACKAGE_JSON_FILE = os.path.join(BASE_DIR, "static", "assets", "package.json")
PACKAGE_JSON_FILE = os.path.join(BASE_DIR, "assets", "package.json")
# Multiple favicons can be specified here. The "href" property # Multiple favicons can be specified here. The "href" property
# is mandatory, but "sizes," "type," and "rel" are optional. # is mandatory, but "sizes," "type," and "rel" are optional.

0
superset/static/.gitkeep Normal file
View File