-
Notifications
You must be signed in to change notification settings - Fork 213
Add Lab to quickstart #678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM node:22 AS builder | ||
|
||
ARG NEXT_PUBLIC_COMMIT_HASH | ||
ENV NEXT_TELEMETRY_DISABLED=1 | ||
ENV PORT=8002 | ||
WORKDIR /lab | ||
RUN git clone https://github.com/stellar/laboratory /lab | ||
RUN git fetch origin ${NEXT_PUBLIC_COMMIT_HASH} | ||
RUN git checkout ${NEXT_PUBLIC_COMMIT_HASH} | ||
RUN yarn install | ||
ENV NEXT_PUBLIC_DEFAULT_NETWORK=custom | ||
ENV NEXT_BASE_PATH=/lab | ||
RUN yarn build | ||
|
||
EXPOSE 8002 | ||
CMD ["npm", "start"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#! /bin/bash | ||
|
||
set -e | ||
set -o pipefail | ||
|
||
echo "starting lab..." | ||
export PORT=8002 | ||
export NEXT_BASE_PATH=/lab | ||
export NEXT_PUBLIC_DEFAULT_NETWORK=custom | ||
./node_modules/.bin/next start |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
location /lab { | ||
proxy_set_header Host $http_host; | ||
proxy_pass http://127.0.0.1:8002; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[program:stellar-lab] | ||
user=stellar | ||
directory=/opt/stellar/lab | ||
command=/opt/stellar-default/common/lab/bin/start | ||
autostart=false | ||
startretries=50 | ||
autorestart=true | ||
priority=60 | ||
redirect_stderr=true |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ export SUPHOME="$STELLAR_HOME/supervisor" | |
export COREHOME="$STELLAR_HOME/core" | ||
export HZHOME="$STELLAR_HOME/horizon" | ||
export FBHOME="$STELLAR_HOME/friendbot" | ||
export LABHOME="$STELLAR_HOME/lab" | ||
export NXHOME="$STELLAR_HOME/nginx" | ||
export STELLAR_RPC_HOME="$STELLAR_HOME/stellar-rpc" | ||
|
||
|
@@ -26,6 +27,7 @@ export PGPORT=5432 | |
: "${ENABLE_LOGS:=false}" | ||
: "${ENABLE_CORE:=false}" | ||
: "${ENABLE_HORIZON:=false}" | ||
: "${ENABLE_LAB:=false}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we remove the enable lab env and instead rely on the enable env var? The other ones for core and horizon are legacy. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, the env can stay, but can we hook it into the ENABLE car as well? |
||
# TODO: Remove once the Soroban RPC name is fully deprecated | ||
: "${ENABLE_SOROBAN_RPC:=false}" | ||
: "${ENABLE_RPC:=$ENABLE_SOROBAN_RPC}" | ||
|
@@ -617,13 +619,19 @@ function start_optional_services() { | |
supervisorctl start postgresql | ||
supervisorctl start stellar-core | ||
fi | ||
|
||
if [ "$ENABLE_HORIZON" == "true" ]; then | ||
supervisorctl start postgresql | ||
supervisorctl start horizon | ||
fi | ||
|
||
if [ "$ENABLE_RPC" == "true" ]; then | ||
supervisorctl start stellar-rpc | ||
fi | ||
|
||
if [ "$ENABLE_LAB" == "true" ]; then | ||
supervisorctl start stellar-lab | ||
fi | ||
} | ||
|
||
function exec_supervisor() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the lab is a static website. Can we build the static site and host it with nginx instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is, but I asked in Slack anyway.