Skip to content

Commit 4b92f62

Browse files
author
yangtao
committed
减小docker build体积,优化构建速度,利用action缓存机制
1 parent fe43978 commit 4b92f62

4 files changed

Lines changed: 8 additions & 39 deletions

File tree

.fastRequest/config/fastRequestCurrentProjectConfig.json

Lines changed: 0 additions & 33 deletions
This file was deleted.

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ CMD ["sh", "-c", "\
9595
done && \
9696
echo '📊 运行数据库迁移...' && \
9797
pnpm exec prisma migrate deploy && \
98+
echo '🔧 初始化系统...' && \
99+
pnpm exec tsx scripts/init-system.ts && \
98100
echo '🎯 启动整合生产服务...' && \
99101
NODE_ENV=production pnpm start \
100102
"]

app/api/auth/login/route.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ export async function POST(request: NextRequest) {
3737
// 设置会话 cookie (24小时过期)
3838
response.cookies.set('session', sessionId, {
3939
httpOnly: true,
40-
secure: process.env.NODE_ENV === 'production',
41-
sameSite: 'strict',
40+
sameSite: 'lax',
4241
maxAge: 24 * 60 * 60, // 24小时
4342
path: '/'
4443
});

docker-compose.release.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ services:
1010
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-nodepass123}
1111
POSTGRES_DB: ${POSTGRES_DB:-nodepass}
1212
volumes:
13-
- postgres_data:/var/lib/postgresql/data
13+
# - postgres_data:/var/lib/postgresql/data
14+
- ./postgres_data:/var/lib/postgresql/data
1415
ports:
1516
- "5432:5432"
1617
restart: unless-stopped
@@ -56,9 +57,9 @@ services:
5657
retries: 5
5758
start_period: 60s
5859

59-
volumes:
60-
postgres_data:
61-
driver: local
60+
# volumes:
61+
# postgres_data:
62+
# driver: local
6263

6364
# 🚀 使用说明:
6465
# 1. 创建 .env 文件并设置环境变量

0 commit comments

Comments
 (0)