feat: add Docker support
Some checks are pending
CI / deploy (push) Waiting to run

This commit is contained in:
thehrz 2024-11-09 17:41:36 +08:00
parent 0a72a41a91
commit 03cbed8c62
Signed by: thehrz
GPG Key ID: C84CBCE7D5F88855
6 changed files with 2585 additions and 2091 deletions

25
.gitea/workflows/ci.yml Normal file
View File

@ -0,0 +1,25 @@
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
# - name: Install Docker
# run: curl -fsSL https://get.docker.com | sh
- name: Deploy with Docker
run: docker compose up --build --force-recreate -d

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ cmd/authlibskin/skin
cmd/authlibskin/authlibskin.exe
server/static/files
cmd/authlibskin/config.toml
out/

23
Dockerfile Normal file
View File

@ -0,0 +1,23 @@
FROM node:20-alpine AS frontend-stage
WORKDIR /app
RUN corepack enable
COPY frontend/package.json frontend/pnpm-lock.yaml ./
RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store \
pnpm install --frozen-lockfile
COPY frontend/ .
RUN pnpm build
FROM golang:1.23 as build-stage
WORKDIR /app
ENV GOPROXY https://goproxy.cn,direct
COPY --from=frontend-stage /app/dist ./server/static/files
COPY . .
RUN go build -o app .
CMD ["/app/app"]

16
docker-compose.yml Normal file
View File

@ -0,0 +1,16 @@
version: "3.9"
networks:
traefik:
name: traefik
external: true
authlib-skin:
name: authlib-skin
services:
authlib-skin:
build: .
container_name: authlib-skin
restart: always
networks:
- authlib-skin

4609
frontend/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

2
go.mod
View File

@ -1,6 +1,6 @@
module github.com/xmdhs/authlib-skin
go 1.21
go 1.23
require (
entgo.io/ent v0.12.3