Skip to content

Commit e726e0b

Browse files
committed
refactor
1 parent a6d6153 commit e726e0b

32 files changed

+532
-752
lines changed

.github/workflows/docker.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Docker
2+
on:
3+
push:
4+
branches: [ master ]
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Compute image tag name
11+
run: echo "IMAGE_TAG=$(date -u '+%Y%m%d-%H%M%S')" >> $GITHUB_ENV
12+
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Login to Dockerhub
17+
uses: docker/login-action@v2
18+
with:
19+
registry: registry.hub.docker.com
20+
username: ${{ secrets.DOCKER_USERNAME }}
21+
password: ${{ secrets.DOCKER_PASSWORD }}
22+
23+
- name: Build image
24+
uses: docker/build-push-action@v4
25+
with:
26+
context: .
27+
platforms: linux/amd64
28+
push: true
29+
build-args: |
30+
GITHUB_SHA=${{ github.sha }}
31+
tags: |
32+
registry.hub.docker.com/wuhan005/elaina:${{ env.IMAGE_TAG }}

.github/workflows/lsif.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/publisher.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

.github/workflows/runtime-c.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/runtime-golang.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/runtime-javascript.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/runtime-php.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/runtime-python.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@
2121
.elaina
2222
volume/
2323
Elaina
24+
/.DS_Store

Dockerfile

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,40 @@
1+
FROM node:latest as node_builder
2+
3+
WORKDIR /app
4+
5+
COPY . .
6+
7+
WORKDIR /app/web
8+
RUN rm -rf node_modules || true
9+
RUN npm install -g pnpm
10+
RUN git init
11+
RUN pnpm install
12+
RUN pnpm run build
13+
14+
FROM golang:1.22-alpine as go_builder
15+
16+
WORKDIR /app
17+
18+
ENV CGO_ENABLED=0
19+
20+
COPY . .
21+
COPY --from=node_builder /app/web/dist ./web/dist
22+
23+
RUN go mod tidy
24+
RUN go build -v -trimpath -ldflags "-w -s -extldflags '-static'" -o elaina .
25+
126
FROM alpine:latest
227

328
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
429
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
530
RUN echo 'Asia/Shanghai' > /etc/timezone
631

7-
RUN mkdir /etc/Elaina
8-
WORKDIR /etc/Elaina
32+
RUN mkdir /etc/elaina
33+
WORKDIR /etc/elaina
934

10-
ADD Elaina /etc/Elaina
35+
COPY --from=go_builder /app/elaina /etc/elaina/elaina
1136

12-
RUN chmod 655 /etc/Elaina/Elaina
37+
RUN chmod 655 /etc/elaina/elaina
1338

14-
ENTRYPOINT ["/etc/Elaina/Elaina"]
39+
ENTRYPOINT ["/etc/elaina/elaina"]
1540
EXPOSE 8080

0 commit comments

Comments
 (0)