joinmarket-webui / jam-docker

https://jamdocs.org
MIT License
14 stars 7 forks source link

Feature request: Add environment variable to set the http port #106

Closed bota87 closed 1 year ago

bota87 commented 1 year ago

I need to use a port different from the default 80, can you add a variable to make this configurable?

theborakompanioni commented 1 year ago

I need to use a port different from the default 80, can you add a variable to make this configurable?

That should be accomplishable, yes! Would you be able to share what the reason is that you want to control and change this parameter?

bota87 commented 1 year ago

sure, I would like to set network_mode: service:wireguard on the jam container to exit with a vpn but the port 80 it's already in use

theborakompanioni commented 1 year ago

sure, I would like to set network_mode: service:wireguard on the jam container to exit with a vpn but the port 80 it's already in use

Would you be able to test https://github.com/joinmarket-webui/jam-docker/pull/108 and report back if it worked the way you need it? That be great :pray:

bota87 commented 1 year ago

I tried to build the image from source but failed, so I edited the jam-entrypoint directly on the running container and I made an image from there. That resolved the conflict for nginx but now the tor service give error, I already have another one attached to the wireguard container so I need a custom port even for that...

failed docker build ``` $ docker build --label "local" --build-arg JAM_REPO_REF=master --build-arg JM_SERVER_REPO_REF=master --tag "jam" ./standalone [+] Building 55.6s (22/32) docker:default => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 4.57kB 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/library/debian:bullseye-20221004-slim 0.5s => [internal] load metadata for docker.io/library/alpine:3.16.2 0.4s => [internal] load build context 0.0s => => transferring context: 523B 0.0s => [builder-base 1/2] FROM docker.io/library/alpine:3.16.2@sha256:65a2763f593ae85fab3b5406dc9e80f744ec5b449f269b699b5efd37a07ad32e 0.0s => [dinit-builder 1/4] FROM docker.io/library/debian:bullseye-20221004-slim@sha256:b46fc4e6813f6cbd9f3f6322c72ab974cc0e75a72ca02730a8861e98999875c7 0.0s => CACHED [stage-4 2/17] RUN addgroup --system tor && adduser --system --disabled-login --ingroup tor --gecos 'tor user' tor && apt-get update && a 0.0s => CACHED [dinit-builder 2/4] RUN apt-get update && apt-get install -qq --no-install-recommends --no-install-suggests -y ca-certificates git gcc make m4 g++ 0.0s => CACHED [dinit-builder 3/4] WORKDIR /usr/src/dinit 0.0s => CACHED [dinit-builder 4/4] RUN git clone "https://github.com/davmac314/dinit" . --depth=1 --branch "v0.16.1" && make && export ASAN_OPTIONS=detect_le 0.0s => CACHED [stage-4 3/17] COPY --from=dinit-builder /usr/src/dinit/dinit-bin/sbin /sbin 0.0s => CACHED [builder-base 2/2] RUN apk add --no-cache --update git 0.0s => CACHED [ui-builder 1/3] RUN apk add --no-cache --update nodejs npm 0.0s => CACHED [ui-builder 2/3] WORKDIR /usr/src/jam 0.0s => CACHED [ui-builder 3/3] RUN git clone "https://github.com/joinmarket-webui/jam" . --depth=1 --branch "master" && npm install --no-fund --no-audit && 0.0s => CACHED [stage-4 4/17] COPY --from=ui-builder /usr/src/jam/build /app 0.0s => CACHED [server-builder 1/2] WORKDIR /usr/src/joinmarket-clientserver 0.0s => CACHED [server-builder 2/2] RUN git clone "https://github.com/JoinMarket-Org/joinmarket-clientserver" . --depth=1 --branch "master" 0.0s => CACHED [stage-4 5/17] COPY --from=server-builder /usr/src/joinmarket-clientserver /src 0.0s => CACHED [stage-4 6/17] WORKDIR /src 0.0s => ERROR [stage-4 7/17] RUN ./install.sh --docker-install --without-qt && rm --recursive --force install.sh deps/cache/ test/ .git/ .gitignore .github/ .c 55.1s ------ > [stage-4 7/17] RUN ./install.sh --docker-install --without-qt && rm --recursive --force install.sh deps/cache/ test/ .git/ .gitignore .github/ .coveragerc joinmarket-qt.desktop: 0.344 /src/deps /src 0.344 /src/deps/cache /src/deps /src 0.355 % Total % Received % Xferd Average Speed Time Time Time Current 0.355 Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 1587k 0 1587k 0 0 29710 0 --:--:-- 0:00:54 --:--:-- 0 55.11 490022745164b56439688b0fc04f9bd43578e5c3.tar.gz: FAILED 55.11 sha256sum: WARNING: 1 computed checksum did NOT match 55.11 libsecp256k1 was not built. Exiting. ------ Dockerfile:115 -------------------- 114 | # compile and install JoinMarket 115 | >>> RUN ./install.sh --docker-install --without-qt \ 116 | >>> && rm --recursive --force install.sh deps/cache/ test/ .git/ .gitignore .github/ .coveragerc joinmarket-qt.desktop 117 | -------------------- ERROR: failed to solve: process "/bin/bash -o pipefail -c ./install.sh --docker-install --without-qt && rm --recursive --force install.sh deps/cache/ test/ .git/ .gitignore .github/ .coveragerc joinmarket-qt.desktop" did not complete successfully: exit code: 1 ```
theborakompanioni commented 1 year ago
$ docker build --label "local" --build-arg JAM_REPO_REF=master --build-arg JM_SERVER_REPO_REF=master --tag "jam" ./standalone

Please try again with the following and report if it builds successfully:

$ docker build --no-cache --label "local" --build-arg JAM_REPO_REF=master --build-arg JM_SERVER_REPO_REF=v0.9.9 --tag "jam" ./standalone

I already have another one attached to the wireguard container so I need a custom port even for that..

Hmm.. maybe it is best to just extend the "standalone" image and build you own image with the values adapted to satisfy your needs? It is done similarly for the regtest env within Jam: https://github.com/joinmarket-webui/jam/blob/master/docker/regtest/dockerfile-deps/joinmarket/webui-standalone/Dockerfile (however, with the dev image, rather than prod). Would that be an acceptable solution for you?

bota87 commented 1 year ago

Please try again with the following and report if it builds successfully:

$ docker build --no-cache --label "local" --build-arg JAM_REPO_REF=master --build-arg JM_SERVER_REPO_REF=v0.9.9 --tag "jam" 

That worked!

maybe it is best to just extend the "standalone" image and build you own image Would that be an acceptable solution for you?

Yeah I can try that way, or maybe even better I try to use the ui-only image Thank's for the support, the issue can be closed for me

theborakompanioni commented 1 year ago

That worked!

:raised_hands:

Yeah I can try that way, or maybe even better I try to use the ui-only image Thank's for the support, the issue can be closed for me

Perfect. Closing! Thank you :pray: