mirror of
https://github.com/wahyd4/passkey-auth.git
synced 2026-08-09 04:15:55 +10:00
- Complete WebAuthn/FIDO2 authentication implementation - SQLite database with user and credential management - Email-based user identification with allowlist support - Admin approval workflow for new users - Session management with secure cookies - Docker containerization with Debian base for SQLite compatibility - Kubernetes deployment manifests with nginx ingress support - Web-based admin interface for user management - Comprehensive documentation and deployment guides - Standard open source project structure with CI/CD
46 lines
962 B
Docker
46 lines
962 B
Docker
# Build stage
|
|
FROM golang:1.21-bullseye AS builder
|
|
|
|
# Install build dependencies including sqlite
|
|
RUN apt-get update && apt-get install -y gcc libsqlite3-dev && rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy go mod files
|
|
COPY go.mod go.sum ./
|
|
|
|
# Download dependencies
|
|
RUN go mod download
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build the application (remove static linking for SQLite compatibility)
|
|
RUN CGO_ENABLED=1 GOOS=linux go build -a -o passkey-auth .
|
|
|
|
# Final stage
|
|
FROM debian:bullseye-slim
|
|
|
|
# Install runtime dependencies
|
|
RUN apt-get update && apt-get install -y ca-certificates libsqlite3-0 && rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /root/
|
|
|
|
# Copy the binary from builder stage
|
|
COPY --from=builder /app/passkey-auth .
|
|
|
|
# Copy web files
|
|
COPY --from=builder /app/web ./web/
|
|
|
|
# Copy default config
|
|
COPY --from=builder /app/config.yaml .
|
|
|
|
# Create directory for database
|
|
RUN mkdir -p /data
|
|
|
|
# Expose port
|
|
EXPOSE 8080
|
|
|
|
# Run the application
|
|
CMD ["./passkey-auth"]
|