This commit is contained in:
parent
bf1881ccb5
commit
5f54220113
3 changed files with 61 additions and 2 deletions
18
.woodpecker.yaml
Normal file
18
.woodpecker.yaml
Normal file
|
@ -0,0 +1,18 @@
|
|||
when:
|
||||
branch: ["main"]
|
||||
event: ["push", "manual"]
|
||||
steps:
|
||||
- name: build
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
settings:
|
||||
repo: git.iwakura.rip/hex/gw
|
||||
platforms: linux/amd64
|
||||
dockerfile: Dockerfile
|
||||
tags:
|
||||
["${CI_COMMIT_BRANCH}-latest", "${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA}"]
|
||||
username: hex
|
||||
registry:
|
||||
git.iwakura.rip
|
||||
#insecure: true
|
||||
password:
|
||||
from_secret: gitpat
|
32
Dockerfile
Normal file
32
Dockerfile
Normal file
|
@ -0,0 +1,32 @@
|
|||
FROM alpine:latest AS compile
|
||||
|
||||
RUN mkdir /build
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
# Add edge repository
|
||||
RUN echo -e "\nhttps://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
|
||||
|
||||
RUN apk update && \
|
||||
apk add pnpm nodejs npm nim nimble go-task git build-base
|
||||
|
||||
ADD . .
|
||||
|
||||
RUN go-task docker-build-frontend
|
||||
RUN go-task docker-build-backend
|
||||
|
||||
RUN echo $(pwd) $(ls)
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk update && \
|
||||
apk add sqlite-dev
|
||||
|
||||
COPY --from=compile /build/gw /app/
|
||||
COPY --from=compile /build/public /app/public
|
||||
|
||||
CMD ["/app/gw"]
|
||||
|
||||
|
11
taskfile.yml
11
taskfile.yml
|
@ -4,7 +4,7 @@ tasks:
|
|||
build-backend:
|
||||
cmds:
|
||||
- rm gw
|
||||
- nimble c -d:usestd src/gw.nim -o:gw
|
||||
- nimble build
|
||||
build-frontend:
|
||||
dir: ./web
|
||||
cmds:
|
||||
|
@ -17,3 +17,12 @@ tasks:
|
|||
dir: ./web
|
||||
cmds:
|
||||
- pnpm run dev
|
||||
docker-build-frontend:
|
||||
dir: ./web
|
||||
cmds:
|
||||
- pnpm install
|
||||
- pnpm run build
|
||||
docker-build-backend:
|
||||
cmds:
|
||||
- rm gw | echo "has not been compiled before"
|
||||
- nimble -y build --gcc.path:"/usr/bin" --gcc.exe:"x86_64-alpine-linux-musl-gcc" --gcc.linkerexe:"x86_64-alpine-linux-musl-gcc" --gcc.options.always:"-static" --define:release --threads:on
|
||||
|
|
Loading…
Reference in a new issue