Skip to content

Commit 0f138e8

Browse files
committed
Bundle faucet
1 parent b8db0b3 commit 0f138e8

File tree

4 files changed

+34
-7
lines changed

4 files changed

+34
-7
lines changed

packages/faucet/Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@ FROM node:14-alpine as build-env
1313
ADD . /app
1414
WORKDIR /app
1515

16-
RUN apk add --update --no-cache alpine-sdk linux-headers build-base gcc libusb-dev python3 py3-pip eudev-dev \
17-
&& ln -sf python3 /usr/bin/python
18-
# Do we really need to update those?
19-
RUN pip3 install --no-cache --upgrade pip setuptools
16+
RUN apk add --update --no-cache alpine-sdk linux-headers build-base gcc libusb-dev python3 py3-pip eudev-dev
17+
RUN ln -sf python3 /usr/bin/python
2018

2119
RUN yarn install && yarn run build
20+
RUN (cd packages/faucet && SKIP_BUILD=1 yarn pack-node)
2221

2322
FROM node:14-alpine
24-
COPY --from=build-env /app /app
23+
COPY --from=build-env /app/packages/faucet /app/packages/faucet
2524
WORKDIR /app
2625

2726
EXPOSE 8000
28-
ENTRYPOINT ["yarn", "node", "/app/packages/faucet/bin/cosmos-faucet"]
27+
ENTRYPOINT ["/app/packages/faucet/bin/cosmos-faucet-dist"]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env node
2+
const path = require("path");
3+
4+
// attempt to call in main file....
5+
const faucet = require(path.join(__dirname, "..", "dist", "node", "cli.js"));
6+
faucet.main(process.argv.slice(2));

packages/faucet/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"test": "yarn build-or-skip && yarn test-node",
3737
"coverage": "nyc --reporter=text --reporter=lcov yarn test --quiet",
3838
"start-dev": "FAUCET_ADDRESS_PREFIX=wasm FAUCET_CREDIT_AMOUNT_UCOSM=10000000 FAUCET_CREDIT_AMOUNT_USTAKE=100000 FAUCET_CONCURRENCY=3 FAUCET_MNEMONIC=\"economy stock theory fatal elder harbor betray wasp final emotion task crumble siren bottom lizard educate guess current outdoor pair theory focus wife stone\" ./bin/cosmos-faucet start \"http://localhost:26659\"",
39-
"start-coralnet": "FAUCET_ADDRESS_PREFIX=coral FAUCET_TOKENS=\"ushell,ureef\" FAUCET_CREDIT_AMOUNT_USHELL=10000000 FAUCET_CREDIT_AMOUNT_UREEF=2000000 FAUCET_CONCURRENCY=3 FAUCET_MNEMONIC=\"economy stock theory fatal elder harbor betray wasp final emotion task crumble siren bottom lizard educate guess current outdoor pair theory focus wife stone\" ./bin/cosmos-faucet start \"https://lcd.coralnet.cosmwasm.com\""
39+
"start-coralnet": "FAUCET_ADDRESS_PREFIX=coral FAUCET_TOKENS=\"ushell,ureef\" FAUCET_CREDIT_AMOUNT_USHELL=10000000 FAUCET_CREDIT_AMOUNT_UREEF=2000000 FAUCET_CONCURRENCY=3 FAUCET_MNEMONIC=\"economy stock theory fatal elder harbor betray wasp final emotion task crumble siren bottom lizard educate guess current outdoor pair theory focus wife stone\" ./bin/cosmos-faucet start \"https://lcd.coralnet.cosmwasm.com\"",
40+
"pack-node": "yarn build-or-skip && webpack --mode production --config webpack.node.config.js"
4041
},
4142
"dependencies": {
4243
"@cosmjs/crypto": "workspace:packages/crypto",
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* eslint-disable @typescript-eslint/naming-convention */
2+
const path = require("path");
3+
4+
const target = "node";
5+
const distdir = path.join(__dirname, "dist", target);
6+
7+
module.exports = [
8+
{
9+
target: target,
10+
entry: "./build/cli.js",
11+
output: {
12+
path: distdir,
13+
filename: "cli.js",
14+
library: {
15+
type: "commonjs",
16+
},
17+
},
18+
plugins: [],
19+
resolve: {},
20+
},
21+
];

0 commit comments

Comments
 (0)