feat: decouple frontend and backend deployment workflows with Docker
Some checks failed
Backend Deploy (Go + Docker) / deploy (push) Failing after 57s
build-and-deploy / build-and-deploy (push) Failing after 57s

This commit is contained in:
zs
2026-02-28 20:20:21 +08:00
parent 1a952d28b2
commit 44ebbd6f9e
4 changed files with 127 additions and 0 deletions

15
server/Dockerfile Normal file
View File

@@ -0,0 +1,15 @@
FROM alpine:latest
# 安装证书 (HTTPS请求需要) 和时区数据
RUN apk --no-cache add ca-certificates tzdata
WORKDIR /app
# 拷贝由 CI 提前编译好的二进制文件
# 这里假设 CI 已经将编译产物命名为 server_bin
COPY server_bin .
RUN chmod +x server_bin
EXPOSE 8080
CMD ["./server_bin"]

18
server/docker-compose.yml Normal file
View File

@@ -0,0 +1,18 @@
version: '3.8'
services:
insight-reply-server:
build: .
container_name: insight-reply-server
restart: always
ports:
- "8080:8080"
environment:
# 这里可以读取宿主机的环境变量或 .env 文件内容
- OPENAI_API_KEY=${OPENAI_API_KEY}
networks:
- insight_network
networks:
insight_network:
driver: bridge