You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
755 B
41 lines
755 B
# Build stage
|
|
FROM golang:alpine AS builder
|
|
|
|
# Install build dependencies
|
|
RUN apk add --no-cache git
|
|
|
|
# Set working directory
|
|
WORKDIR /src
|
|
|
|
# Copy only go.mod and go.sum first to leverage Docker caching
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
# Copy the entire repository
|
|
COPY . .
|
|
|
|
# Build the tsidp binary
|
|
RUN go build -o /bin/tsidp ./cmd/tsidp
|
|
|
|
# Final stage
|
|
FROM alpine:latest
|
|
|
|
# Create necessary directories
|
|
RUN mkdir -p /var/lib/tsidp
|
|
|
|
# Copy binary from builder stage
|
|
COPY --from=builder /bin/tsidp /app/tsidp
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Environment variables
|
|
ENV TAILSCALE_USE_WIP_CODE=1 \
|
|
TS_HOSTNAME=tsidp \
|
|
TS_STATE_DIR=/var/lib/tsidp
|
|
|
|
# Expose the default port
|
|
EXPOSE 443
|
|
|
|
# Run the application
|
|
ENTRYPOINT ["/app/tsidp"] |