-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
60 lines (44 loc) · 1.66 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# ---> build the broker binary
FROM golang:1.21-bookworm as broker
# install more required software
#RUN apt update && apt install -y --no-install-recommends \
# compile the binary
WORKDIR /broker
COPY ./broker /broker
RUN CGO_ENABLED=0 go build -o broker
# ---> build the webprovider frontend dist
FROM node:20-bookworm as frontend
# compile the frontend
WORKDIR /provider
COPY ./webprovider /provider
RUN yarn install && yarn build
# ---> prepare an image with headless chromium as provider
FROM alpine:latest as provider
RUN apk add --no-cache chromium
ENV WASIMOFF_BROKER="http://localhost:4080"
ENV WASIMOFF_WORKERS="max"
ENTRYPOINT chromium --headless=new --verbose --enable-logging=stderr \
--disable-extensions --no-sandbox \
--no-first-run --no-default-browser-check \
--no-pings --in-process-gpu \
"$WASIMOFF_BROKER/#autoconnect=yes&workers=$WASIMOFF_WORKERS"
# ---> combine broker and frontend dist
FROM alpine:latest as wasimoff
RUN apk add --no-cache curl
COPY --from=broker /broker/broker /broker
COPY --from=frontend /provider/dist /provider
ENTRYPOINT [ "/broker" ]
# :: configuration ::
# the TCP port to listen on with the plaintext HTTP server
ENV WASIMOFF_HTTP_LISTEN=":4080"
# the UDP port for the QUIC/WebTransport server
ENV WASIMOFF_QUIC_LISTEN=":4443"
# paths to certificate pair for the QUIC server, generate ephemeral if empty
ENV WASIMOFF_QUIC_CERT=
ENV WASIMOFF_QUIC_KEY=
# use certificates to enable TLS on HTTP server, too?
ENV WASIMOFF_HTTPS=false
# externally-reachable URL to the QUIC server
ENV WASIMOFF_TRANSPORT_URL="https://localhost:4443/transport"
# filesystem path to frontend dist to be served
ENV WASIMOFF_STATIC_FILES="/provider"