2022-03-02 16:25:22 +01:00
|
|
|
# Confio hosts a faucet build at https://hub.docker.com/r/confio/faucet
|
|
|
|
#
|
2022-03-01 16:39:31 +01:00
|
|
|
# Build:
|
2022-04-12 13:08:07 +02:00
|
|
|
# docker build --pull -t confio/faucet:manual -f packages/faucet/Dockerfile .
|
2022-03-01 16:39:31 +01:00
|
|
|
# Run:
|
2022-03-02 16:25:22 +01:00
|
|
|
# docker run --rm confio/faucet:manual version
|
2022-04-12 13:08:07 +02:00
|
|
|
#
|
|
|
|
# During the build step the working directory must be the repo root such that the
|
|
|
|
# app has access to all installed dependencies.
|
2022-03-01 16:39:31 +01:00
|
|
|
|
2022-03-02 10:59:51 +01:00
|
|
|
FROM node:14-alpine as build-env
|
2022-03-01 15:12:44 +01:00
|
|
|
|
|
|
|
ADD . /app
|
|
|
|
WORKDIR /app
|
|
|
|
|
2022-04-12 14:04:30 +02:00
|
|
|
RUN apk add --update --no-cache alpine-sdk linux-headers build-base gcc libusb-dev python3 py3-pip eudev-dev
|
|
|
|
RUN ln -sf python3 /usr/bin/python
|
2022-03-01 15:12:44 +01:00
|
|
|
|
|
|
|
RUN yarn install && yarn run build
|
2022-04-12 14:04:30 +02:00
|
|
|
RUN (cd packages/faucet && SKIP_BUILD=1 yarn pack-node)
|
2022-03-01 15:12:44 +01:00
|
|
|
|
2022-04-12 15:42:09 +02:00
|
|
|
# Use Alpine and install Node.js which is 50% smaller than the -alpine version of the node
|
|
|
|
# image (53 MB including the faucet app).
|
|
|
|
FROM alpine:3.15
|
|
|
|
# Installs Node.js 16 (https://pkgs.alpinelinux.org/packages?name=nodejs&branch=v3.15)
|
|
|
|
RUN apk add --update nodejs
|
|
|
|
|
2022-04-12 14:04:30 +02:00
|
|
|
COPY --from=build-env /app/packages/faucet /app/packages/faucet
|
2022-03-02 10:59:51 +01:00
|
|
|
WORKDIR /app
|
|
|
|
|
2022-03-01 15:12:44 +01:00
|
|
|
EXPOSE 8000
|
2022-04-12 14:04:30 +02:00
|
|
|
ENTRYPOINT ["/app/packages/faucet/bin/cosmos-faucet-dist"]
|