validops-east-1 commited on
Commit
698f782
·
1 Parent(s): 6cd5bf4
Files changed (2) hide show
  1. Dockerfile +13 -4
  2. start.sh +2 -2
Dockerfile CHANGED
@@ -6,12 +6,21 @@
6
  # variable injected by the deployment platform / start.sh (single source of
7
  # truth = the main application's environment / .env). The Go module requires
8
  # Go 1.25.
 
 
 
 
 
9
  # ---------------------------------------------------------------------------
10
- FROM golang:1.25.0-alpine AS whatsapp-build
11
 
12
- RUN echo "https://dl-4.alpinelinux.org/alpine/v3.22/main" > /etc/apk/repositories \
13
- && echo "https://dl-4.alpinelinux.org/alpine/v3.22/community" >> /etc/apk/repositories \
14
- && apk update && apk add --no-cache git build-base libjpeg-turbo-dev libwebp-dev
 
 
 
 
15
 
16
  WORKDIR /build
17
 
 
6
  # variable injected by the deployment platform / start.sh (single source of
7
  # truth = the main application's environment / .env). The Go module requires
8
  # Go 1.25.
9
+ #
10
+ # IMPORTANT: the build image MUST be glibc-based (bookworm), NOT Alpine. The
11
+ # CGO build links against glibc; a binary built on Alpine (musl) cannot be
12
+ # executed by the Debian runtime image ("cannot execute: required file not
13
+ # found").
14
  # ---------------------------------------------------------------------------
15
+ FROM golang:1.25.0-bookworm AS whatsapp-build
16
 
17
+ RUN apt-get update && apt-get install -y --no-install-recommends \
18
+ build-essential \
19
+ git \
20
+ libjpeg62-turbo-dev \
21
+ libwebp-dev \
22
+ pkg-config \
23
+ && rm -rf /var/lib/apt/lists/*
24
 
25
  WORKDIR /build
26
 
start.sh CHANGED
@@ -112,7 +112,7 @@ if [ -z "$WHATSAPP_SERVICE_ENABLED" ]; then
112
  fi
113
 
114
  export WHATSAPP_SERVICE_ENABLED
115
- export WHATSAPP_SERVICE_URL="${WHATSAPP_SERVICE_URL:-http://127.0.0.1:${WHATSAPP_SERVICE_PORT}}"
116
  # Single source of truth: operator sets one of WHATSAPP_SERVICE_GLOBAL_API_KEY /
117
  # GLOBAL_API_KEY; both the gateway (FastAPI) and the Go service receive it.
118
  export WHATSAPP_SERVICE_GLOBAL_API_KEY="${WHATSAPP_SERVICE_GLOBAL_API_KEY:-${GLOBAL_API_KEY:-}}"
@@ -162,7 +162,7 @@ if [ "$WHATSAPP_SERVICE_ENABLED" = "true" ]; then
162
  log "WhatsApp service process group PID: $WHATSAPP_PID"
163
 
164
  # Wait for readiness (best effort — non-fatal, gateway degrades gracefully)
165
- WHATSAPP_HEALTH_URL="http://127.0.0.1:${WHATSAPP_SERVICE_PORT}/server/ok"
166
  WHATSAPP_READY=0
167
  for _ in $(seq 1 30); do
168
  if curl -fsS -o /dev/null "$WHATSAPP_HEALTH_URL" 2>/dev/null; then
 
112
  fi
113
 
114
  export WHATSAPP_SERVICE_ENABLED
115
+ export WHATSAPP_SERVICE_URL="${WHATSAPP_SERVICE_URL:-http://localhost:${WHATSAPP_SERVICE_PORT}}"
116
  # Single source of truth: operator sets one of WHATSAPP_SERVICE_GLOBAL_API_KEY /
117
  # GLOBAL_API_KEY; both the gateway (FastAPI) and the Go service receive it.
118
  export WHATSAPP_SERVICE_GLOBAL_API_KEY="${WHATSAPP_SERVICE_GLOBAL_API_KEY:-${GLOBAL_API_KEY:-}}"
 
162
  log "WhatsApp service process group PID: $WHATSAPP_PID"
163
 
164
  # Wait for readiness (best effort — non-fatal, gateway degrades gracefully)
165
+ WHATSAPP_HEALTH_URL="http://localhost:${WHATSAPP_SERVICE_PORT}/server/ok"
166
  WHATSAPP_READY=0
167
  for _ in $(seq 1 30); do
168
  if curl -fsS -o /dev/null "$WHATSAPP_HEALTH_URL" 2>/dev/null; then