star-cloud/mqtt-gateway/Dockerfile
sky121113 bf43a33df3 [FEAT] 整合 MQTT 資料流自動化與環境埠號修復
1. 整合 MQTT Gateway 並支援動態 Redis Key 前綴隔離,解決多環境衝突。
2. 修正本地開發環境與 Demo 環境的埠號映射 (80/8080) 與 Vite HMR (5175) 設定。
3. 更新 CI/CD 部署流程,新增自動同步程式碼至 MQTT Worker 與 Queue 容器。
4. 擴充 .env.example 以提供完整的 MQTT/EMQX 相關變數範本。
5. 更新模擬腳本以符合現有測試資料。
2026-04-17 13:22:46 +08:00

25 lines
450 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Stage 1: Build
FROM golang:1.23-alpine AS builder
WORKDIR /app
# 複製依賴檔案
COPY go.mod ./
# 註:如果沒有 go.sumbuild 時會自動處理或報錯,我們先建立 basic
RUN go mod download || true
COPY . .
RUN CGO_ENABLED=0 go build -o gateway .
# Stage 2: Run
FROM alpine:3.20
# 安裝 tzdata 以支援時區設定
RUN apk add --no-cache tzdata
WORKDIR /root/
COPY --from=builder /app/gateway .
# 運行
CMD ["./gateway"]