tercul-backend/Dockerfile
Damir Mukimov 4957117cb6 Initial commit: Tercul Go project with comprehensive architecture
- Core Go application with GraphQL API using gqlgen
- Comprehensive data models for literary works, authors, translations
- Repository pattern with caching layer
- Authentication and authorization system
- Linguistics analysis capabilities with multiple adapters
- Vector search integration with Weaviate
- Docker containerization support
- Python data migration and analysis scripts
- Clean architecture with proper separation of concerns
- Production-ready configuration and middleware
- Proper .gitignore excluding vendor/, database files, and build artifacts
2025-08-13 07:42:32 +02:00

37 lines
780 B
Docker

FROM golang:1.24-alpine AS builder
# Install git and required dependencies
RUN apk add --no-cache git build-base
# Set working directory
WORKDIR /app
# Copy go mod and sum files
COPY go.mod go.sum ./
# Download all dependencies
RUN go mod download
# Copy the source code
COPY . .
# Build the application with optimizations
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags="-s -w" -o tercul .
# Use a small alpine image for the final container
FROM alpine:latest
# Add ca-certificates for secure connections
RUN apk --no-cache add ca-certificates tzdata
# Set working directory
WORKDIR /root/
# Copy the binary from builder
COPY --from=builder /app/tercul .
# Expose the application port
EXPOSE 8080
# Command to run the application
CMD ["./tercul"]