2023-11-14 09:15:59 +00:00
|
|
|
FROM node:21-alpine as nodebuild
|
2020-10-16 08:08:18 +00:00
|
|
|
|
2022-01-10 13:06:19 +00:00
|
|
|
WORKDIR /go/src/git.happydns.org/happydomain
|
2020-10-16 08:08:18 +00:00
|
|
|
|
2021-07-06 23:03:18 +00:00
|
|
|
COPY ui/ ui/
|
2020-10-16 08:08:18 +00:00
|
|
|
|
2021-11-22 12:05:19 +00:00
|
|
|
RUN yarn config set network-timeout 100000 && \
|
|
|
|
yarn --cwd ui install && \
|
|
|
|
yarn --cwd ui --offline build
|
2020-10-16 08:08:18 +00:00
|
|
|
|
|
|
|
|
2021-11-01 09:35:18 +00:00
|
|
|
FROM golang:1-alpine as gobuild
|
2020-10-16 08:08:18 +00:00
|
|
|
|
2022-03-20 02:07:35 +00:00
|
|
|
RUN apk add --no-cache git
|
2020-10-16 08:08:18 +00:00
|
|
|
|
2022-01-10 13:06:19 +00:00
|
|
|
WORKDIR /go/src/git.happydns.org/happydomain
|
2020-10-16 08:08:18 +00:00
|
|
|
|
2022-01-10 13:06:19 +00:00
|
|
|
COPY --from=nodebuild /go/src/git.happydns.org/happydomain/ ./
|
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
|
2021-07-06 23:03:18 +00:00
|
|
|
COPY internal ./internal
|
2020-10-16 08:08:18 +00:00
|
|
|
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
|
2021-07-06 23:03:18 +00:00
|
|
|
COPY generate.go go.mod go.sum main.go ./
|
2020-10-16 08:08:18 +00:00
|
|
|
|
2023-08-05 16:15:52 +00:00
|
|
|
RUN sed -i '/npm run build/d' ui/assets.go && \
|
|
|
|
go install github.com/swaggo/swag/cmd/swag@latest && \
|
|
|
|
go generate -v ./... && \
|
2023-12-24 17:42:54 +00:00
|
|
|
go build -v -tags listmonk,netgo,swagger,ui -ldflags '-w'
|
2020-10-16 08:08:18 +00:00
|
|
|
|
|
|
|
|
2023-12-10 09:16:55 +00:00
|
|
|
FROM alpine:3.19
|
2020-10-16 08:08:18 +00:00
|
|
|
|
|
|
|
EXPOSE 8081
|
|
|
|
|
2023-09-15 09:19:00 +00:00
|
|
|
ENTRYPOINT ["/usr/sbin/happyDomain"]
|
2020-10-16 08:08:18 +00:00
|
|
|
|
2022-01-10 13:06:19 +00:00
|
|
|
ENV HAPPYDOMAIN_LEVELDB_PATH=/data/happydomain.db
|
2020-10-16 08:08:18 +00:00
|
|
|
|
2021-01-11 00:47:48 +00:00
|
|
|
RUN apk add --no-cache \
|
|
|
|
curl \
|
|
|
|
jq \
|
|
|
|
&& \
|
2022-01-10 13:06:19 +00:00
|
|
|
adduser --system --no-create-home --uid 15353 happydomain && \
|
|
|
|
mkdir /data && chown happydomain /data
|
|
|
|
USER happydomain
|
2021-01-11 13:19:59 +00:00
|
|
|
WORKDIR /data
|
|
|
|
|
|
|
|
VOLUME /data
|
2021-01-10 16:31:18 +00:00
|
|
|
|
2023-09-15 09:19:00 +00:00
|
|
|
COPY --from=gobuild /go/src/git.happydns.org/happydomain/happyDomain /usr/sbin/happyDomain
|
2021-01-10 15:56:04 +00:00
|
|
|
COPY hadmin.sh /usr/bin/hadmin
|