-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
71 lines (50 loc) · 2.2 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
61
62
63
64
65
66
67
68
69
70
71
FROM rust:1.72.0-bookworm AS rust-builder
COPY ./vss-rs ./build/vss-rs
COPY ./ln-websocket-proxy ./build/ln-websocket-proxy
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends git python3 make build-essential clang cmake libsnappy-dev openssl libpq-dev pkg-config libc6 && rm -rf /var/lib/apt/lists/*
# Install vss-rs
WORKDIR /build/vss-rs
RUN cargo build --release
# Install ln-websocket-proxy
WORKDIR /build/ln-websocket-proxy
RUN cargo build --release --features="server"
# Use Node.js for building the site
FROM node:20-slim AS web-builder
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
COPY ./mutiny-web /app
WORKDIR /app
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends git python3 make build-essential && rm -rf /var/lib/apt/lists/*
# This is the cooler way to run pnpm these days (no need to npm install it)
RUN corepack enable
# Add the ARG directives for build-time environment variables
ARG VITE_NETWORK="bitcoin"
ARG VITE_PROXY="/_services/proxy"
ARG VITE_PRIMAL="https://primal-cache.mutinywallet.com/api"
ARG VITE_ESPLORA
ARG VITE_SCORER="https://scorer.mutinywallet.com"
ARG VITE_LSP="https://0conf.lnolymp.us"
ARG VITE_RGS
ARG VITE_AUTH
ARG VITE_STORAGE="/_services/vss/v2"
ARG VITE_SELFHOSTED="true"
ARG VITE_COMMIT_HASH
# Install dependencies
RUN pnpm install --frozen-lockfile
# Build the static site
RUN pnpm run build
FROM nginx:bookworm
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends postgresql-15 && rm -rf /var/lib/apt/lists/* && mv /var/lib/postgresql/15/main /var/lib/
# Copy binaries
COPY --from=rust-builder /build/vss-rs/target/release/vss-rs /app/vss-rs
COPY --from=rust-builder /build/ln-websocket-proxy/target/release/ln_websocket_proxy /app/ln-websocket-proxy
# Copy static assets
COPY --from=web-builder /app/dist/public /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
ADD ./docker_entrypoint.sh /usr/local/bin/docker_entrypoint.sh
ADD ./check-web.sh /usr/local/bin/check-web.sh
RUN chmod +x /usr/local/bin/check-web.sh
EXPOSE 80
STOPSIGNAL SIGINT
ENV DATABASE_URL="postgres://postgres:docker@localhost/vss"
ENV SELF_HOST="true"