You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
999 B

# ADMIN DASHBOARD BUILD
FROM node:lts-alpine as build-client
WORKDIR /build/client
RUN apk add --no-cache make
COPY . /build/
RUN npm install \
&& npm run build \
&& mkdir -p /build/.bin/static \
&& cp -R ./public /build/.bin/static
# DNS/API SERVER BUILD
FROM golang:alpine as build-server
WORKDIR /build/
RUN apk add --no-cache --update make gcc musl-dev git
COPY --from=build-client /build /build
RUN make .bin/gopherhole
# RUNTIME ENVIRONMENT
FROM alpine
WORKDIR /opt
RUN apk add --no-cache ca-certificates
RUN adduser -H -D gopherhole \
&& mkdir -p /data \
&& chown -R gopherhole /data
COPY --chown=gopherhole:gopherhole --from=build-server /build/.bin/gopherhole /opt/gopherhole
USER gopherhole
# host:port address for upstream dns server to do resolution on
ENV GOPHERHOLE_UPSTREAM="1.1.1.1:53"
EXPOSE 53/udp 53/tcp 80/tcp
VOLUME "/data"
CMD /opt/gopherhole -http-address=0.0.0.0:80 -dns-address=0.0.0.0:53 -upstream ${GOPHERHOLE_UPSTREAM} -db-path /data