24 lines
738 B
Docker
24 lines
738 B
Docker
FROM node:20.18.1
|
|
|
|
# Set up node
|
|
RUN npm install -g n && n install 22.14.0 && n use 22.14.0 && hash -r
|
|
|
|
# If iproute2 is not installed,
|
|
# node can't figure out what address to bind 0.0.0.0 to
|
|
RUN apt-get update && apt-get install iproute2 python3 --yes \
|
|
&& git clone https://github.com/httptoolkit/httptoolkit-ui
|
|
|
|
WORKDIR httptoolkit-ui
|
|
RUN git checkout ac44f8e6e1f5f41be988a32eb89c98f57723d005 \
|
|
&& npm i && npm run server:setup
|
|
|
|
ARG DOCKER_HOST=localhost
|
|
|
|
# This gets sent to the browser as a server URL,
|
|
# so it is important that it is set to the domain / ip of the server.
|
|
|
|
RUN sed -i "s/127.0.0.1/${DOCKER_HOST}/" src/model/proxy-store.ts \
|
|
&& npm run build:default # Can take a long time
|
|
|
|
CMD npm exec static-server ./dist -o
|