File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -27,9 +27,9 @@ FROM ubuntu:24.04 AS runner
2727ARG COMMIT_SHA
2828WORKDIR /app
2929
30- # Install ca-certificates, curl for HTTPS requests
30+ # Install ca-certificates, curl, jq for HTTPS requests and URL encoding
3131RUN apt-get update && \
32- apt-get install -y ca-certificates curl && \
32+ apt-get install -y ca-certificates curl jq && \
3333 apt-get clean && \
3434 rm -rf /var/lib/apt/lists/*
3535
Original file line number Diff line number Diff line change @@ -10,11 +10,12 @@ COPY cmd/token_service/ ./cmd/token_service/
1010COPY internal/ ./internal/
1111
1212# Download dependencies and build
13+ # Note: CGO is required for SQLite support
1314RUN cd cmd/token_service && \
1415 go mod tidy && \
15- CGO_ENABLED=0 GOOS=linux go build \
16+ CGO_ENABLED=1 GOOS=linux go build \
1617 -ldflags="-X 'main.Version=${COMMIT_SHA}' -s -w" \
17- -a -installsuffix cgo \
18+ -a \
1819 -o token_service .
1920
2021# Multi-stage build - use a minimal image for runtime
Original file line number Diff line number Diff line change @@ -16,7 +16,9 @@ atlas migrate hash --dir "file:///app/migrations/sqlite" 2>/dev/null || true
1616case $BACKEND in
1717 postgres)
1818 echo " Applying PostgreSQL migrations..."
19- DB_URL=" postgres://${OPENTACO_POSTGRES_USER} :${OPENTACO_POSTGRES_PASSWORD} @${OPENTACO_POSTGRES_HOST} :${OPENTACO_POSTGRES_PORT} /${OPENTACO_POSTGRES_DATABASE} ?sslmode=${OPENTACO_POSTGRES_SSLMODE:- disable} "
19+ # URL-encode the password to handle special characters
20+ ENCODED_PASSWORD=$( printf ' %s' " $OPENTACO_POSTGRES_PASSWORD " | jq -sRr @uri)
21+ DB_URL=" postgres://${OPENTACO_POSTGRES_USER} :${ENCODED_PASSWORD} @${OPENTACO_POSTGRES_HOST} :${OPENTACO_POSTGRES_PORT} /${OPENTACO_POSTGRES_DATABASE} ?sslmode=${OPENTACO_POSTGRES_SSLMODE:- disable} "
2022 atlas migrate apply --url " $DB_URL " --dir " file:///app/migrations/postgres"
2123 ;;
2224 mysql)
You can’t perform that action at this time.
0 commit comments