-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from Jinnrry/v2.3.8
V2.3.8
Showing
4 changed files
with
50 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM golang:alpine as serverbuild | ||
|
||
WORKDIR /work | ||
|
||
COPY server . | ||
|
||
RUN apk update && apk add git | ||
RUN go build -ldflags "-X 'main.goVersion=$(go version)' -X 'main.gitHash=$(git show -s --format=%H)' -X 'main.buildTime=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)'" -o pmail main.go | ||
|
||
|
||
FROM alpine | ||
|
||
WORKDIR /work | ||
|
||
# 设置时区 | ||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories | ||
RUN apk add --no-cache tzdata \ | ||
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ | ||
&& echo "Asia/Shanghai" > /etc/timezone \ | ||
&&rm -rf /var/cache/apk/* /tmp/* /var/tmp/* $HOME/.cache | ||
|
||
|
||
COPY --from=serverbuild /work/pmail . | ||
|
||
|
||
CMD /work/pmail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
build: build_fe build_server package | ||
|
||
clean: | ||
rm -rf output | ||
|
||
build_fe: | ||
cd fe && yarn && yarn build | ||
cd server && cp -rf ../fe/dist http_server | ||
|
||
build_server: | ||
cd server && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X 'main.goVersion=$(go version)' -X 'main.gitHash=$(git show -s --format=%H)' -X 'main.buildTime=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)'" -o pmail_linux_amd64 main.go | ||
cd server && CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -X 'main.goVersion=$(go version)' -X 'main.gitHash=$(git show -s --format=%H)' -X 'main.buildTime=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)'" -o pmail_windows_amd64.exe main.go | ||
cd server && CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -X 'main.goVersion=$(go version)' -X 'main.gitHash=$(git show -s --format=%H)' -X 'main.buildTime=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)'" -o pmail_mac_amd64 main.go | ||
cd server && CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w -X 'main.goVersion=$(go version)' -X 'main.gitHash=$(git show -s --format=%H)' -X 'main.buildTime=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)'" -o pmail_mac_arm64 main.go | ||
|
||
package: clean | ||
mkdir output | ||
mv server/pmail* output/ | ||
mkdir config | ||
cp -r server/config/dkim output/config/ | ||
cp -r server/config/ssl output/config/ | ||
cp -r server/config/config.json output/config/ | ||
cp README.md output/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters