Skip to content

Commit

Permalink
add frontend build
Browse files Browse the repository at this point in the history
  • Loading branch information
containerman17 committed Sep 23, 2024
1 parent 76d5c28 commit 5049975
Show file tree
Hide file tree
Showing 8 changed files with 379 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{$SERVE_DOMAIN} {
reverse_proxy /faucet/* faucet:8765
reverse_proxy /ext/* devnet:9650
reverse_proxy /* frontend:5173
reverse_proxy /* frontend:80

tls {
on_demand
Expand Down
15 changes: 9 additions & 6 deletions Dockerfile.frontend
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ WORKDIR /app

COPY web_wallet/package.json web_wallet/package-lock.json ./

RUN --mount=type=cache,target=/root/.npm \
npm ci --prefer-offline
# RUN --mount=type=cache,target=/root/.npm \
# npm ci --prefer-offline
# FIXME:
RUN --mount=type=cache,target=/root/.npm npm install

COPY web_wallet/ ./web_wallet/

WORKDIR /app/web_wallet

CMD npm run dev -- --host 0.0.0.0
# RUN npm run build
# CMD npm run dev -- --host 0.0.0.0
# FIXME:
RUN npm run build-no-check

# # Production stage
# FROM nginx:latest
FROM nginx:latest

# COPY --from=build /app/web_wallet/dist /usr/share/nginx/html
COPY --from=build /app/web_wallet/dist /usr/share/nginx/html
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ Note that most functionality depends on the `hypersdk-client` npm package.
- Frontend: `npm run dev` in `web_wallet`
- Explorer: Use the provided Docker image or set up your own instance
- Be aware of potential port conflicts if issues arise. `docker rm -f $(docker ps -a -q)` is your friend.
- To update the explorer image, run `docker compose pull explorer` before starting the stack.
- To update the explorer image, run `docker compose pull explorer` before starting the stack.
- To release on a remote machine, set `export DOCKER_HOST="ssh://username@ip"` and run `docker compose pull && docker compose up -d --build proxy`.
2 changes: 1 addition & 1 deletion compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
context: ./
restart: always
ports:
- "127.0.0.1:5173:5173"
- "127.0.0.1:5173:80"
healthcheck:
test: [ "CMD", "curl", "-X", "POST", "http://localhost:5173/"]
interval: 10s
Expand Down
Loading

0 comments on commit 5049975

Please sign in to comment.