Skip to content

Commit

Permalink
fix: 修复 CI
Browse files Browse the repository at this point in the history
  • Loading branch information
wanglu committed Apr 10, 2022
1 parent ba1c613 commit 4f88af2
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
ui
**/node_modules
**/dist
**/build
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
name: Login to AliyunCS
uses: docker/login-action@v1
with:
registry: registry.cn-shanghai.aliyuncs.com
username: ${{ secrets.ALI_USER }}
password: ${{ secrets.ALI_PASSWORD }}
-
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: install node-gpy
run: |
apt install -y python3 make gcc g++
- name: build public files
run: |
echo "清空原有数据"
rm -rf ./public
mkdir public/admin
mkdir -p public/admin
echo '构建用户页面'
cd ui/website && && pnpm install && pnpm build && cd ../../
cp -r ui/website/build/* public/
Expand Down
39 changes: 34 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
FROM ubuntu:20.04
FROM mereith/node-gyp:14 AS feBuilder
WORKDIR /app
COPY ./nav /app/nav
# VOLUME [ "/data" ]
EXPOSE 8233
ENTRYPOINT [ "/app/nav" ]
# RUN apk add --no-cache --virtual .build-deps alpine-sdk python
COPY . .
RUN yarn config set registry https://registry.npm.taobao.org && yarn global add typescript
RUN cd /app && cd ui/admin && yarn && yarn build && cd ../..
RUN cd ui/website && yarn && yarn build && cd ../..
RUN cd /app && mkdir -p public/admin
RUN cp -r ui/website/build/* public/
RUN cp -r ui/admin/dist/* public/admin/
RUN sed -i 's/\/assets/\/admin\/assets/g' public/admin/index.html


FROM golang:alpine AS binarybuilder
RUN apk --no-cache --no-progress add git
WORKDIR /app
COPY . .
COPY --from=feBuilder /app/public /app/public
RUN cd /app && ls -la && go mod tidy && go build .



FROM alpine:latest
ENV TZ="Asia/Shanghai"
RUN apk --no-cache --no-progress add \
ca-certificates \
tzdata && \
cp "/usr/share/zoneinfo/$TZ" /etc/localtime && \
echo "$TZ" > /etc/timezone
WORKDIR /app
COPY --from=binarybuilder /app/nav /app/

VOLUME ["/app/data"]
EXPOSE 6412
ENTRYPOINT [ "/app/nav" ]
2 changes: 2 additions & 0 deletions node-gyp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM node:14-alpine
RUN apk add --no-cache g++ gcc make python3
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.7
1.0.10

0 comments on commit 4f88af2

Please sign in to comment.