Рыба проекта. Минимальная функциональность

This commit is contained in:
2026-08-03 22:22:24 +03:00
commit 8c8631ac9c
80 changed files with 10618 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
FROM golang:1.26-alpine AS builder
WORKDIR /src
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/root/go/pkg/mod go mod download
COPY . .
RUN --mount=type=cache,target=/root/go/pkg/mod CGO_ENABLED=0 go build -o /out/synapse-backupper ./cmd/synapse-backupper
FROM alpine:3.24
RUN apk add --no-cache postgresql18-client ca-certificates && update-ca-certificates
RUN addgroup -S app && adduser -S -G app app
COPY --from=builder --chown=app:app /out/synapse-backupper /usr/local/bin/synapse-backupper
USER app
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s CMD wget -qO- http://localhost:8080/healthz || exit 1
LABEL maintainer="infra@tswf.io" version="0.1.0" description="Synapse PostgreSQL backup tool with composite dual-KEM encryption"
ENTRYPOINT ["/usr/local/bin/synapse-backupper"]
CMD ["run"]
+28
View File
@@ -0,0 +1,28 @@
version: '3.8'
services:
synapse-backupper:
image: synapse-backupper:latest
volumes:
- ./backups:/backups
- ./keys:/keys:ro
environment:
- APP_PG_HOST=db
- APP_PG_DATABASE=postgres
- APP_PG_USER=synapse
- APP_PG_PASSWORD=changeme
- APP_PQ_PUBLIC_KEY_PATH=/keys/synapse.pq.pub.pem
- APP_CLASSICAL_PUBLIC_KEY_PATH=/keys/synapse.classical.pub.pem
- APP_BACKUP_DIR=/backups
- APP_BACKUP_CRON=0 0 3 * * *
networks:
- my-network
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:8080/healthz"]
interval: 30s
timeout: 3s
start_period: 10s
restart: unless-stopped
networks:
my-network:
external: true