mirror of
https://github.com/SamyRai/tercul-backend.git
synced 2025-12-27 05:11:34 +00:00
Some checks failed
- Updated database models and repositories to replace uint IDs with UUIDs. - Modified test fixtures to generate and use UUIDs for authors, translations, users, and works. - Adjusted mock implementations to align with the new UUID structure. - Ensured all relevant functions and methods are updated to handle UUIDs correctly. - Added necessary imports for UUID handling in various files.
38 lines
797 B
Docker
38 lines
797 B
Docker
FROM golang:1.25-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 ./cmd/cli
|
|
|
|
# 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 API server
|
|
CMD ["./tercul", "serve"]
|