2021-05-20 07:56:37 +00:00
|
|
|
FROM node:lts-alpine as nodebuild
|
2020-10-16 08:08:18 +00:00
|
|
|
|
|
|
|
WORKDIR /go/src/git.happydns.org/happydns
|
|
|
|
|
|
|
|
RUN apk --no-cache add python2 build-base
|
|
|
|
|
|
|
|
COPY htdocs/ htdocs/
|
|
|
|
|
2020-11-08 19:55:31 +00:00
|
|
|
RUN yarn config set network-timeout 100000
|
2020-10-16 08:08:18 +00:00
|
|
|
RUN yarn --cwd htdocs install
|
|
|
|
RUN yarn --cwd htdocs --offline build
|
|
|
|
|
|
|
|
|
|
|
|
FROM golang:alpine as gobuild
|
|
|
|
|
|
|
|
RUN apk add --no-cache go-bindata
|
|
|
|
|
|
|
|
WORKDIR /go/src/git.happydns.org/happydns
|
|
|
|
|
|
|
|
COPY --from=nodebuild /go/src/git.happydns.org/happydns/ ./
|
2021-04-20 16:04:44 +00:00
|
|
|
COPY actions ./actions
|
2020-10-16 08:08:18 +00:00
|
|
|
COPY admin ./admin
|
|
|
|
COPY api ./api
|
|
|
|
COPY config ./config
|
|
|
|
COPY forms ./forms
|
|
|
|
COPY generators ./generators
|
|
|
|
COPY model ./model
|
2021-05-22 00:10:36 +00:00
|
|
|
COPY providers ./providers
|
2020-10-16 08:08:18 +00:00
|
|
|
COPY services ./services
|
|
|
|
COPY storage ./storage
|
|
|
|
COPY utils ./utils
|
|
|
|
COPY generate.go go.mod go.sum main.go static.go ./
|
|
|
|
|
|
|
|
RUN sed -i '/yarn --cwd htdocs --offline build/d' static.go && \
|
|
|
|
go get -d -v && \
|
|
|
|
go generate -v && \
|
2021-05-17 22:42:52 +00:00
|
|
|
go build -v -ldflags '-w'
|
2020-10-16 08:08:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
FROM alpine
|
|
|
|
|
|
|
|
EXPOSE 8081
|
|
|
|
|
2021-01-10 16:31:18 +00:00
|
|
|
ENTRYPOINT ["/usr/sbin/happydns"]
|
2020-10-16 08:08:18 +00:00
|
|
|
|
|
|
|
ENV HAPPYDNS_LEVELDB_PATH=/data/happydns.db
|
|
|
|
|
2021-01-11 00:47:48 +00:00
|
|
|
RUN apk add --no-cache \
|
|
|
|
curl \
|
|
|
|
jq \
|
|
|
|
&& \
|
|
|
|
adduser --system --no-create-home --uid 15353 happydns && \
|
2021-01-11 13:19:59 +00:00
|
|
|
mkdir /data && chown happydns /data
|
2021-01-10 16:31:18 +00:00
|
|
|
USER happydns
|
2021-01-11 13:19:59 +00:00
|
|
|
WORKDIR /data
|
|
|
|
|
|
|
|
VOLUME /data
|
2021-01-10 16:31:18 +00:00
|
|
|
|
2021-01-10 15:56:04 +00:00
|
|
|
COPY --from=gobuild /go/src/git.happydns.org/happydns/happydns /usr/sbin/happydns
|
|
|
|
COPY hadmin.sh /usr/bin/hadmin
|