build: optimize Dockerfiles for production and pin dependencies

Implement multi-stage build and static server for frontend
Run containers as non-root user and set production environment
Pin all package dependencies to exact versions
This commit is contained in:
2026-05-03 15:35:00 +08:00
parent 7aa80430d9
commit 590bd6a0ae
7 changed files with 165 additions and 57 deletions

View File

@@ -13,17 +13,17 @@
"test": "node --test --import tsx tests/*.test.ts"
},
"dependencies": {
"@fastify/cors": "latest",
"@fastify/multipart": "^10.0.0",
"@fastify/rate-limit": "^10.3.0",
"@fastify/static": "^9.1.3",
"fastify": "latest",
"pg": "latest"
"@fastify/cors": "11.2.0",
"@fastify/multipart": "10.0.0",
"@fastify/rate-limit": "10.3.0",
"@fastify/static": "9.1.3",
"fastify": "5.8.5",
"pg": "8.20.0"
},
"devDependencies": {
"@types/node": "latest",
"@types/pg": "latest",
"tsx": "latest",
"typescript": "latest"
"@types/node": "25.6.0",
"@types/pg": "8.20.0",
"tsx": "4.21.0",
"typescript": "6.0.3"
}
}