build multi tenant

This commit is contained in:
2025-10-12 15:47:00 +07:00
parent e466e2f801
commit 1fbb202002
24 changed files with 1947 additions and 29 deletions

33
Dockerfile Normal file
View File

@@ -0,0 +1,33 @@
# Dockerfile for Geek-Life v2.0 Multi-Tenant
FROM golang:1.19-alpine AS builder
WORKDIR /app
# Install dependencies
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . .
# Build the application
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o geek-life app/*.go
# Final stage
FROM alpine:latest
RUN apk --no-cache add ca-certificates tzdata
WORKDIR /root/
# Copy the binary
COPY --from=builder /app/geek-life .
COPY --from=builder /app/migrations ./migrations/
COPY --from=builder /app/.env.example .
# Create non-root user
RUN adduser -D -s /bin/sh geeklife
USER geeklife
EXPOSE 8080
CMD ["./geek-life"]