chore: fix docker build

This commit is contained in:
cooder
2024-02-29 10:48:46 +08:00
parent a22c6da3d8
commit d53eb6f2f8
4 changed files with 14 additions and 3 deletions
+3 -1
View File
@@ -48,4 +48,6 @@ ENV MAX_REQUEST_PER_MINUTE=60
ENV AUTH_CODE=""
ENV DATABASE_URL=""
CMD ["npm", "run", "start:migrate:prod"]
RUN chmod +x ./docker-bootstrap.sh
CMD ["./docker-bootstrap.sh"]
+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh
# ENVIRONEMTN from docker-compose.yaml doesn't get through to subprocesses
# Need to explicit pass DATABASE_URL here, otherwise migration doesn't work
# Run migrations
DATABASE_URL=${DATABASE_URL} npx prisma migrate deploy
# start app
DATABASE_URL=${DATABASE_URL} node dist/main
+1
View File
@@ -5,6 +5,7 @@ datasource db {
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "linux-musl"] // 生成linux可执行文件
}
// 读书账号
+2 -2
View File
@@ -8,8 +8,8 @@ services:
# 请修改为自己的密码
MYSQL_ROOT_PASSWORD: 123456
TZ: 'Asia/Shanghai'
ports:
- 3306:3306
# ports:
# - 3306:3306
server:
image: cooderl/wewe-rss-server:latest