forked from kingwrcy/moments
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
wangrui06
committed
Apr 8, 2024
1 parent
0d1df32
commit 1c60c66
Showing
11 changed files
with
50 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,4 @@ logs | |
.env.* | ||
!.env.example | ||
|
||
assets/upload | ||
assets/upload/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Nuxt 3 builder | ||
FROM node:lts as builder | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
COPY prisma ./prisma | ||
|
||
# 安装依赖 | ||
RUN npm install | ||
|
||
# 生成Prisma客户端 | ||
RUN npx prisma generate | ||
|
||
|
||
# 构建Nuxt应用 | ||
RUN npm run build | ||
|
||
# Nuxt 3 production | ||
FROM node:lts | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/.output /app/.output | ||
COPY --from=builder /app/prisma /app/prisma | ||
|
||
RUN npm init -y | ||
RUN npm install prisma --save-dev | ||
|
||
# 运行数据库迁移 | ||
RUN npx prisma migrate deplpoy | ||
|
||
RUN mkdir /app/assets/upload | ||
|
||
ENV NODE_ENV=production | ||
|
||
EXPOSE 3000 | ||
|
||
CMD [ "node", ".output/server/index.mjs" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
insert into User(username,nickname,password,avatarUrl,slogan,coverUrl,createdAt,updatedAt) values ('admin','Jerry','$2a$10$3n9B1VzOMK7gWLkM7XeM1OMHV5x4EDc8hkePyk/wrY0YAT6KPOiW2 | ||
','https://ui-avatars.com/api/?name=admin','时间不在于你拥有多少,而在于你怎样使用。','https://s2.loli.net/2024/04/08/htPAFmRJ9eZlHwq.png',datetime('now'),datetime('now')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- This is an empty migration. | ||
update User set avatarUrl = 'https://p.sda1.dev/16/d5e9d23595a62cae6ffbc8984c109cd2/face.png' where id = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters