mirror of
https://github.com/farcasterxyz/hub-monorepo.git
synced 2026-01-29 23:17:59 -05:00
We want to make it easier for developers to get started with hubs. Add a separate optimized Docker image which we'll distribute for both AMD and ARM architectures. For now the publishing process is manual, but once hubs are fully open (no peering allowlists) we'll be able to auto-publish with each hubble release on NPM.
48 lines
1.3 KiB
Docker
48 lines
1.3 KiB
Docker
# Produces the Docker image published at farcasterxyz/hubble
|
|
#
|
|
# This assumes the Docker build context is the root of the monorepo
|
|
# (i.e. not the same as
|
|
|
|
FROM node:18.16.0-alpine3.17 as build
|
|
|
|
# Needed for compilation step
|
|
RUN apk add --no-cache libc6-compat python3 make g++ linux-headers
|
|
|
|
USER node
|
|
RUN mkdir /home/node/app
|
|
WORKDIR /home/node/app
|
|
|
|
WORKDIR /home/node/app/apps/hubble
|
|
|
|
# Don't include yarn.lock since that's for the monorepo, not Hubble specifically
|
|
COPY ./apps/hubble/package.json ./package.json
|
|
|
|
RUN yarn install --production --prefer-offline
|
|
|
|
WORKDIR /home/node/app
|
|
|
|
COPY ./tsconfig.json ./tsconfig.json
|
|
COPY ./apps/hubble/tsconfig.json ./apps/hubble/tsconfig.json
|
|
COPY ./apps/hubble/.config ./apps/hubble/.config
|
|
COPY ./apps/hubble/src ./apps/hubble/src
|
|
|
|
FROM node:18.16.0-alpine3.17 as app
|
|
|
|
# Requirement for runtime metrics integrations
|
|
RUN apk add --no-cache libc6-compat
|
|
|
|
USER node
|
|
RUN mkdir /home/node/app
|
|
WORKDIR /home/node/app
|
|
|
|
COPY --from=build /home/node/app ./
|
|
|
|
# BuildKit doesn't support the --squash flag, so we emulate it
|
|
# copying everything into a single layer.
|
|
FROM scratch
|
|
COPY --from=app / /
|
|
|
|
WORKDIR /home/node/app/apps/hubble
|
|
|
|
CMD ["yarn", "start", "--ip", "0.0.0.0", "--gossip-port", "2282", "--rpc-port", "2283", "--eth-rpc-url", "https://eth-goerli.g.alchemy.com/v2/IvjMoCKt1hT66f9OJoL_dMXypnvQYUdd", "--network", "1"]
|