Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Use a specific version of Go with Alpine for building
FROM golang:1.23.3-alpine AS builder

# Install build tools and dependencies
RUN apk add --no-cache git
# Install build tools and dependencies (cgo + SQLite headers for go-sqlite3)
RUN apk add --no-cache git build-base sqlite-dev

# Set the working directory inside the container
WORKDIR /app
Expand All @@ -16,17 +16,17 @@ RUN go mod download
# Copy the rest of the application code
COPY . .

# Set environment variables for Go
ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64
# Set environment variables for Go (cgo enabled so go-sqlite3 works)
ENV CGO_ENABLED=1 GOOS=linux GOARCH=amd64

# Build the Go application
RUN go build -o main ./cmd

# Use an Alpine image for runtime
FROM alpine:latest

# Install CA certificates for HTTPS
RUN apk add --no-cache ca-certificates
# Install CA certificates for HTTPS and SQLite runtime libs (if linked dynamically)
RUN apk add --no-cache ca-certificates sqlite-libs

# Set the working directory inside the container
WORKDIR /app
Expand Down