diff --git a/Dockerfile b/Dockerfile index feb93e5..bff0df1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build stage -FROM golang:1.24-alpine3.21 AS builder +FROM golang:1.24-alpine3.21@sha256:a57b286438c2b1503d639cb0c8e170b6a72f46de3fad72d0e00fc1c3383ab952 AS builder # Install build dependencies (with retry logic for network issues) RUN apk update && apk add --no-cache git make || \ @@ -25,7 +25,7 @@ RUN go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest && \ RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o embapi main.go # Runtime stage -FROM alpine:3.21 +FROM alpine:3.21@sha256:7e6b9fa64f522478522f563b3180b58e98f55b4ffc0dccabc1855371467ec67d # Update package index and install ca-certificates for HTTPS (with retry logic) RUN apk update && apk add --no-cache ca-certificates wget || \ diff --git a/docker-compose.yml b/docker-compose.yml index d7c2c08..27a4172 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ services: # PostgreSQL with pgvector extension postgres: - image: pgvector/pgvector:0.7.4-pg16 + image: pgvector/pgvector:0.7.4-pg16@sha256:0f7adb53ad971b3fb78e71f2b5daaa88a94c8b0731b114e4673cbf281da0c691 container_name: embapi-postgres environment: POSTGRES_USER: ${SERVICE_DBUSER:-postgres} @@ -33,14 +33,14 @@ services: SERVICE_DEBUG: ${SERVICE_DEBUG:-false} SERVICE_HOST: ${SERVICE_HOST:-0.0.0.0} SERVICE_PORT: ${SERVICE_PORT:-8880} - + # Database configuration SERVICE_DBHOST: ${SERVICE_DBHOST:-postgres} SERVICE_DBPORT: ${SERVICE_DBPORT:-5432} SERVICE_DBUSER: ${SERVICE_DBUSER:-postgres} SERVICE_DBPASSWORD: ${SERVICE_DBPASSWORD:-postgres} SERVICE_DBNAME: ${SERVICE_DBNAME:-embapi} - + # Security configuration SERVICE_ADMINKEY: ${SERVICE_ADMINKEY} ENCRYPTION_KEY: ${ENCRYPTION_KEY} diff --git a/docs/content/development/testing.md b/docs/content/development/testing.md index b8c0875..91ebe8b 100644 --- a/docs/content/development/testing.md +++ b/docs/content/development/testing.md @@ -175,7 +175,7 @@ func setupTestDatabase(t *testing.T) *pgxpool.Pool { // Create PostgreSQL container with pgvector req := testcontainers.ContainerRequest{ - Image: "pgvector/pgvector:0.7.4-pg16", + Image: "pgvector/pgvector:0.7.4-pg16@sha256:0f7adb53ad971b3fb78e71f2b5daaa88a94c8b0731b114e4673cbf281da0c691", ExposedPorts: []string{"5432/tcp"}, Env: map[string]string{ "POSTGRES_PASSWORD": "password",