From ce9f70b2e5d4e25951a2a4fbe629f25c125f9de8 Mon Sep 17 00:00:00 2001 From: Andy Lim <125596831+andylim-duo@users.noreply.github.com> Date: Tue, 21 Feb 2023 02:27:43 -0500 Subject: [PATCH] Fixes for local docker environment (#12382) Signed-off-by: Andy Lim --- docker/local/Dockerfile | 4 ++++ docker/local/install_local_dependencies.sh | 5 ++++- docker/local/run.sh | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docker/local/Dockerfile b/docker/local/Dockerfile index ec7a1db0f9d..b5f96f62c36 100644 --- a/docker/local/Dockerfile +++ b/docker/local/Dockerfile @@ -34,6 +34,10 @@ ENV PATH="/var/opt/etcd:${PATH}" RUN mkdir /vt/local COPY examples/local /vt/local +# Copy the vtadmin web app to the correct location and npm install +COPY --chown=vitess:vitess web /web +RUN npm install /web/vtadmin + RUN mkdir /vt/common COPY examples/common /vt/common diff --git a/docker/local/install_local_dependencies.sh b/docker/local/install_local_dependencies.sh index b723ee99452..e570d0dc196 100755 --- a/docker/local/install_local_dependencies.sh +++ b/docker/local/install_local_dependencies.sh @@ -3,7 +3,7 @@ # This is a script that gets run as part of the Dockerfile build # to install dependencies for the vitess/mini image. # -# Usage: install_mini_dependencies.sh +# Usage: install_local_dependencies.sh set -euo pipefail @@ -20,3 +20,6 @@ mkdir -p /var/run/etcd && chown -R vitess:vitess /var/run/etcd # Clean up files we won't need in the final image. rm -rf /var/lib/apt/lists/* + +# Install npm and node dependencies for vtadmin +curl -fsSL https://deb.nodesource.com/setup_19.x | bash - && apt-get install -y nodejs diff --git a/docker/local/run.sh b/docker/local/run.sh index 23a97f9843c..9239748ff81 100755 --- a/docker/local/run.sh +++ b/docker/local/run.sh @@ -1,3 +1,3 @@ #!/bin/bash -docker run -p 15000:15000 -p 15001:15001 -p 15991:15991 -p 15999:15999 -p 16000:16000 --rm -it vitess/local +docker run -p 14201:14201 -p 15000:15000 -p 15001:15001 -p 15991:15991 -p 15999:15999 -p 16000:16000 --rm -it vitess/local