Skip to content
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

build(spaceward): fix Docker image #9

Merged
merged 4 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,45 @@ COPY --from=build-env /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
USER svcuser
EXPOSE 8080
ENTRYPOINT ["/wardenkms"]

## spaceward
FROM node:lts-alpine as spaceward-builder
RUN npm install -g pnpm

WORKDIR /wardenprotocol
COPY ts-client ./ts-client
RUN mkdir spaceward
COPY spaceward/package*.json spaceward/.npmrc spaceward/
RUN cd spaceward && pnpm install
COPY . .

ENV VITE_FAUCET_URL=%FAUCET_URL%
ENV VITE_WARDEN_RPC_URL=%WARDEN_RPC_URL%
ENV VITE_WARDEN_REST_URL=%WARDEN_REST_URL%
ENV VITE_WARDEN_CHAIN_ID_NUM=%WARDEN_CHAIN_ID_NUM%
ENV VITE_WARDEN_CHAIN_ID=%WARDEN_CHAIN_ID%
ENV VITE_WARDEN_CHAIN_NAME=%WARDEN_CHAIN_NAME%

RUN cd spaceward && pnpm run build

FROM nginx:1.25.3-alpine3.18-perl as spaceward
WORKDIR /var/www/app
EXPOSE 8080

COPY ./spaceward/entrypoint.sh /opt/entrypoint.sh
COPY ./spaceward/nginx.conf /etc/nginx/nginx.conf
COPY --from=spaceward-builder /wardenprotocol/spaceward/dist .

RUN touch /var/run/nginx.pid && \
chown -R 1000 /var/run/nginx.pid && \
chown -R 1000 /var/cache/nginx && \
chown -R 1000 /var/www/app && \
chown -R 1000 /etc/nginx/conf.d/ && \
mkdir -p /var/log/nginx && \
mkdir -p /var/run/nginx && \
chown -R 1000 /var/log/nginx && \
chown -R 1000 /var/run/nginx/

USER 1000
ENTRYPOINT ["sh", "/opt/entrypoint.sh"]
CMD ["nginx-fe"]
38 changes: 0 additions & 38 deletions spaceward/Dockerfile

This file was deleted.

4 changes: 2 additions & 2 deletions spaceward/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<body class="font-sans">
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<script src="./node_modules/preline/dist/preline.js"></script>
<script type="module" src="./node_modules/preline/dist/preline.js"></script>
</body>

</html>
</html>
3 changes: 2 additions & 1 deletion spaceward/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"build": "vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
Expand Down Expand Up @@ -78,6 +78,7 @@
"tailwindcss-animate": "^1.0.7",
"use-debounce": "^9.0.4",
"vite-plugin-node-polyfills": "^0.17.0",
"wardenprotocol-warden-client-ts": "file:../ts-client",
"web3": "^4.3.0",
"web3-eth-accounts": "^4.1.0",
"zod": "^3.22.4"
Expand Down
22 changes: 21 additions & 1 deletion spaceward/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading