-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # docker/Dockerfile.dev # examples/frontend/angular/dist/casper/index.html # examples/frontend/angular/libs/components/src/lib/header/header.component.ts
- Loading branch information
Showing
31 changed files
with
7,942 additions
and
7,350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,33 @@ | ||
FROM --platform=linux/amd64 node:22.1.0-alpine3.19 as build | ||
FROM --platform=linux/amd64 node:22.13-alpine as build | ||
|
||
ENV NODE_ENV "production" | ||
ENV NODE_ENV "development" | ||
ARG BUILD_CONFIGURATION=production | ||
|
||
WORKDIR /app | ||
|
||
# Update npm to the latest version | ||
RUN npm install -g npm@latest | ||
|
||
COPY ./examples/frontend/angular . | ||
COPY pkg pkg | ||
|
||
RUN rm package-lock.json | ||
RUN rm -rf node_modules package-lock.json | ||
# Until pkg is npm copy files and change path to root | ||
RUN sed -i 's|\"casper-sdk\": \"file:\(\.\.\/\)\+pkg\"|\"casper-sdk\": \"file:pkg\"|' package.json | ||
RUN sed -i 's/"input": "\(\.\.\/\)\+pkg"/\"input": "pkg"/g' project.json | ||
|
||
# optional | ||
# Build proxy from template | ||
RUN npm run build-proxy-conf | ||
# Proxy localhost to gateway | ||
RUN if [ "$BUILD_CONFIGURATION" = "docker" ]; then \ | ||
sed -i 's|http://localhost|http://172.17.0.1|g' proxy.conf.json; \ | ||
fi | ||
RUN npm install --ignore-scripts --verbose && npm update | ||
|
||
RUN npm install --verbose | ||
RUN npm run build -- --configuration=$BUILD_CONFIGURATION --verbose | ||
|
||
# Build for docker env and remove devDependencies | ||
RUN npm run build -- --configuration=$BUILD_CONFIGURATION --verbose \ | ||
&& npm prune --production | ||
FROM python:3.13-slim | ||
|
||
FROM --platform=linux/amd64 node:22.1.0-alpine3.19 | ||
ENV PORT 8080 | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=build --chown=node:node /app/dist/casper ./dist/ | ||
COPY --from=build --chown=node:node /app/proxy.conf.json . | ||
|
||
# Install express and http-proxy-middleware packages | ||
RUN npm install express http-proxy-middleware | ||
|
||
# Copy the custom server script | ||
COPY ./docker/server-prod.js . | ||
|
||
EXPOSE 8080 | ||
|
||
# Exposing another port needs server-prod.jsto get the exposed port | ||
# ENV PORT 8080 | ||
|
||
CMD ["node", "server-prod.js"] | ||
CMD ["python3", "-m", "http.server", "8080", "--directory", "/app/dist"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,27 @@ | ||
FROM --platform=linux/amd64 node:22.1.0-alpine3.19 | ||
FROM --platform=linux/amd64 node:22.13-alpine as build | ||
|
||
ENV NODE_ENV "development" | ||
|
||
# /dev/rpc network adress (optional) | ||
ENV RPC_ADDRESS "http://localhost:11101" | ||
|
||
WORKDIR /app | ||
|
||
# Update npm to the latest version | ||
RUN npm install -g npm@latest | ||
|
||
COPY ./examples/frontend/angular . | ||
|
||
COPY pkg pkg | ||
|
||
# Until pkg is npm copy files and change path to root | ||
RUN rm package-lock.json | ||
RUN rm -rf node_modules package-lock.json | ||
RUN sed -i 's|\"casper-sdk\": \"file:\(\.\.\/\)\+pkg\"|\"casper-sdk\": \"file:pkg\"|' package.json | ||
RUN sed -i 's/"input": "\(\.\.\/\)\+pkg"/\"input": "pkg"/g' project.json | ||
|
||
RUN npm install --ignore-scripts --verbose && npm update | ||
|
||
# Build proxy from template | ||
RUN npm run build-proxy-conf | ||
# Proxy localhost to gateway | ||
RUN sed -i 's|http://localhost|http://172.17.0.1|g' proxy.conf.json | ||
|
||
RUN npm install --verbose | ||
|
||
CMD npm run serve -- --configuration=docker | ||
|
||
EXPOSE 4200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM node:14-alpine | ||
|
||
# Set environment variables for production | ||
ENV NODE_ENV=production | ||
ENV NODE_PATH=/usr/local/lib/node_modules | ||
|
||
# Optional: If you want to manage versions directly, use ARG | ||
ARG version=latest | ||
|
||
# Install dependencies globally | ||
RUN npm install -g cors-anywhere@$version | ||
|
||
# Copy the server.js file into the container | ||
COPY ./docker/server.js /app/server.js | ||
|
||
# Set the working directory for the container | ||
WORKDIR /app | ||
|
||
# Expose the port your app will run on | ||
EXPOSE 11100 | ||
|
||
# Run the server when the container starts | ||
CMD ["node", "server.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Config from https://github.com/make-software/casper-nctl-docker/blob/master/cors/server.js | ||
|
||
// Listen on a specific host via the HOST environment variable | ||
var host = process.env.HOST || '0.0.0.0'; | ||
// Listen on a specific port via the PORT environment variable | ||
var port = process.env.PORT || 11100; | ||
|
||
const originWhitelist = ( | ||
process.env.ORIGIN_WHITELIST || | ||
` | ||
http://localhost:8080, | ||
http://localhost:4200, | ||
http://127.0.0.1:8080, | ||
http://127.0.0.1:4200 | ||
` | ||
) | ||
.replace(/\s+/g, '') | ||
.split(','); | ||
|
||
var cors_proxy = require('cors-anywhere'); | ||
cors_proxy | ||
.createServer({ | ||
originWhitelist, | ||
requireHeader: ['origin', 'x-requested-with'], | ||
removeHeaders: ['cookie', 'cookie2'], | ||
}) | ||
.listen(port, host, function () { | ||
console.log('Running CORS Anywhere on ' + host + ':' + port); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+9.7 KB
(100%)
examples/frontend/angular/dist/casper/assets/casper_rust_wasm_sdk_bg.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions
1
examples/frontend/angular/dist/casper/highlight.worker.cd5315c90b2a3de5.js
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
examples/frontend/angular/dist/casper/highlight.worker.ce91c96e2c4c27a5.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
examples/frontend/angular/dist/casper/polyfills.376204005635514d.js
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
examples/frontend/angular/dist/casper/polyfills.b7ecd408d58033fa.js
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
examples/frontend/angular/dist/casper/runtime.5debcb79cff10eb2.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
examples/frontend/angular/dist/casper/runtime.a201a20accf2fb4b.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.