merge pr#253 to support next.js 14 and add docker deploy.

This commit is contained in:
dongqi shen 2025-01-15 15:20:29 +08:00
parent 43cff8ef77
commit 2d9c8a1454
6 changed files with 6521 additions and 5159 deletions

View file

@ -67,6 +67,7 @@ If you have some suggestions, feel free to create an issue.
## Running Locally
### With pnpm
1. Install dependencies using pnpm:
```sh
@ -85,6 +86,14 @@ cp .env.example .env.local
pnpm dev
```
### With Docker and docker compose
```sh
pnpm docker-dev
```
## License
Licensed under the [MIT license](https://github.com/shadcn/taxonomy/blob/main/LICENSE.md).

7
docker-run.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh -e
OPTS="-f ./docker/docker-compose.yml"
docker-compose $OPTS down --volumes
docker-compose $OPTS up -d db
docker-compose $OPTS up -d web

9
docker/Dockerfile Normal file
View file

@ -0,0 +1,9 @@
FROM node:20 as base
RUN npm install -g pnpm
COPY ../ /app
WORKDIR /app
FROM base as base_build
RUN sh -c 'yes | pnpm install'

36
docker/docker-compose.yml Normal file
View file

@ -0,0 +1,36 @@
version: "3.7"
services:
web:
build:
target: base_build
context: ../
dockerfile: ./docker/Dockerfile
args:
- BUILDKIT_INLINE_CACHE=1
ports:
- "3000:3000"
working_dir: /app
volumes:
- ../:/app
- ./.env.local:/app/.env.local
command: [ "pnpm", "dev" ]
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: 'db'
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'password'
MYSQL_ROOT_PASSWORD: 'password'
ports:
- '3306:3306'
expose:
- '3306'
volumes:
- my-db:/var/lib/mysql
# Names our volume
volumes:
my-db:

View file

@ -13,7 +13,8 @@
"start": "next start",
"lint": "next lint",
"preview": "next build && next start",
"postinstall": "prisma generate"
"postinstall": "prisma generate",
"docker-dev": "./docker-run.sh"
},
"dependencies": {
"@editorjs/code": "^2.9.0",

File diff suppressed because it is too large Load diff