build: refactor production containers
Production containers now copy the Zeppelin source files at build-time rather than using a shared volume. This means fewer permission issues and backend/dashboard builds only have to run once at build-time, not every time the containers are started. Docs in PRODUCTION.md have been updated accordingly.
This commit is contained in:
parent
b60a7fb145
commit
b67b3c35b7
8 changed files with 60 additions and 64 deletions
|
@ -1,3 +1,13 @@
|
|||
FROM node:18 AS builder
|
||||
USER node
|
||||
|
||||
COPY --chown=node:node . /zeppelin
|
||||
|
||||
WORKDIR /zeppelin/dashboard
|
||||
RUN ls -lah
|
||||
RUN pwd
|
||||
RUN npm ci && npm run build
|
||||
|
||||
FROM nginx
|
||||
|
||||
ARG API_PORT
|
||||
|
@ -6,6 +16,8 @@ ARG DOCKER_PROD_DOMAIN
|
|||
RUN apt-get update && apt-get install -y openssl
|
||||
RUN openssl req -x509 -newkey rsa:4096 -keyout /etc/ssl/private/zeppelin-self-signed-cert.key -out /etc/ssl/certs/zeppelin-self-signed-cert.pem -days 3650 -subj "/CN=${DOCKER_PROD_DOMAIN}" -nodes
|
||||
|
||||
COPY ./default.conf /etc/nginx/conf.d/default.conf
|
||||
COPY ./docker/production/nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||
RUN sed -ir "s/_API_PORT_/${API_PORT}/g" /etc/nginx/conf.d/default.conf
|
||||
RUN sed -ir "s/_DOCKER_PROD_DOMAIN_/${DOCKER_PROD_DOMAIN}/g" /etc/nginx/conf.d/default.conf
|
||||
|
||||
COPY --from=builder /zeppelin/dashboard/dist /var/www
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue