Загрузить файлы в «/»

This commit is contained in:
2026-04-28 15:18:40 +00:00
parent 60669d60ec
commit 2b7c8b6100
5 changed files with 55 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
# syntax=docker/dockerfile:1
FROM golang:1.22-alpine AS build
WORKDIR /src
RUN apk add --no-cache git
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/matrix-qr-login ./cmd/server
FROM alpine:3.20
RUN apk add --no-cache ca-certificates
COPY --from=build /out/matrix-qr-login /usr/local/bin/matrix-qr-login
EXPOSE 8080
USER nobody
ENTRYPOINT ["/usr/local/bin/matrix-qr-login"]
+13
View File
@@ -0,0 +1,13 @@
.PHONY: build run test docker-build
build:
go build -o bin/matrix-qr-login ./cmd/server
run:
go run ./cmd/server
test:
go test ./...
docker-build:
docker build -t matrix-qr-login:latest .
+19
View File
@@ -0,0 +1,19 @@
services:
matrix-qr-login:
build: .
image: matrix-qr-login:latest
ports:
- "8080:8080"
environment:
MATRIX_HOMESERVER: "https://jb.evilfox.cc"
SERVER_PORT: "8080"
TOKEN_USES: "1"
TOKEN_EXPIRY_SECONDS: "300"
LOG_LEVEL: "info"
MATRIX_USE_UNSTABLE_MSC3882: "false"
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8080/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 5s
+5
View File
@@ -0,0 +1,5 @@
module matrix-qr-login
go 1.22
require github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
+2
View File
@@ -0,0 +1,2 @@
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M=