Skip to content

Commit

Permalink
chore: fix dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
cooderl committed Feb 29, 2024
1 parent a22c6da commit a449231
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20-alpine AS base
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

Expand Down Expand Up @@ -48,4 +48,4 @@ ENV MAX_REQUEST_PER_MINUTE=60
ENV AUTH_CODE=""
ENV DATABASE_URL=""

CMD ["npm", "run", "start:migrate:prod"]
CMD ["./docker-bootstrap.sh"]
8 changes: 8 additions & 0 deletions apps/server/docker-bootstrap.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a449231

Please sign in to comment.