diff --git a/Dockerfile b/Dockerfile index 7ed5ad950a..2f719909a3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,12 @@ +FROM node:10 as frontend-builder + +WORKDIR /frontend +COPY package.json package-lock.json /frontend/ +RUN npm install + +COPY . /frontend +RUN npm run build + FROM redash/base:latest # Controls whether to install extra dependencies needed for all data sources. @@ -9,10 +18,10 @@ COPY requirements.txt requirements_dev.txt requirements_all_ds.txt ./ RUN pip install -r requirements.txt -r requirements_dev.txt RUN if [ "x$skip_ds_deps" = "x" ] ; then pip install -r requirements_all_ds.txt ; else echo "Skipping pip install -r requirements_all_ds.txt" ; fi -COPY . ./ -RUN npm install && npm run bundle && npm run build && rm -rf node_modules +COPY . /app +COPY --from=frontend-builder /frontend/client/dist /app/client/dist RUN chown -R redash /app USER redash ENTRYPOINT ["/app/bin/docker-entrypoint"] -CMD ["server"] \ No newline at end of file +CMD ["server"]