build multi tenant
This commit is contained in:
33
Dockerfile
Normal file
33
Dockerfile
Normal 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"]
|
||||
Reference in New Issue
Block a user