-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
13 changed files
with
2,422 additions
and
32 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
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,39 @@ | ||
# MySQL 配置 | ||
# mysql镜像版本 | ||
MYSQL_IMAGE_VERSION=8.0.32 | ||
# mysql root用户密码 | ||
MYSQL_ROOT_PASSWORD=example | ||
# mysql 配置挂载卷 | ||
MYSQL_VOLUMES_CONF_DIR=./mysql/config | ||
# mysql 数据挂载卷 | ||
MYSQL_VOLUMES_DATA_DIR=./mysql/data | ||
# mysql 初始数据库的名称 | ||
MYSQL_DATABASE=example | ||
# mysql 宿主端口 | ||
MYSQL_PORT=13306 | ||
|
||
# Redis 配置 | ||
# redis镜像版本 | ||
REDIS_IMAGE_VERSION=7.0.10-alpine | ||
# redis配置文件 | ||
REDIS_VOLUMES_CONF=./redis/config/redis.conf | ||
# redis持久化挂载卷 | ||
REDIS_VOLUMES_DATA_DIR=./redis/data | ||
# redis 连接密码 | ||
REDIS_PASSWORD=example | ||
# redis 宿主端口 | ||
REDIS_PORT=16379 | ||
|
||
# Postgres 配置 | ||
# postgres 镜像版本 | ||
POSTGRES_IMAGE_VERSION=15.2-alpine | ||
# postgres 初始用户 | ||
POSTGRES_USER=example | ||
# postgres 初始用户的密码 | ||
POSTGRES_PASSWORD=example | ||
# postgres 默认数据库 | ||
POSTGRES_DB=example | ||
# postgres 端口 | ||
POSTGRES_PORT=15432 | ||
# postgres 挂载卷 | ||
POSTGRES_VOLUMES_DATA_DIR=./postgres/data |
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,3 @@ | ||
redis/data | ||
mysql/data | ||
postgres/data |
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,15 @@ | ||
# Deploy | ||
> 部署环境,作为迅速搭建项目依赖环境使用 | ||
## 部署基础环境 | ||
|
||
当前目录下创建 `.env` 文件并把.env.example文件内容复制进去,按需调整. | ||
|
||
`docker compose up -d` 一键启动mysql, redis, postgres容器环境,也可修改`docker-compose.yml`文件,按需启动所需容器 | ||
|
||
## 数据库数据初始化 | ||
> 执行前需要确保已经同步Prisma数据库架构,如未同步请参考 [Prisma ORM](../README.md#Prisma ORM 管理) | ||
根据需要调整当前目录下的 `constants.ts` 文件 | ||
|
||
项目根目录执行 `npm run seed` 进行数据初始化, 如果有问题需要回滚可执行 `npm run seed:rollback`. |
File renamed without changes.
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,44 @@ | ||
version: "3" | ||
networks: | ||
local_network: | ||
driver: bridge | ||
services: | ||
mysql: | ||
image: mysql:${MYSQL_IMAGE_VERSION} | ||
restart: always | ||
networks: | ||
- local_network | ||
environment: | ||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} | ||
MYSQL_DATABASE: ${MYSQL_DATABASE} | ||
volumes: | ||
- ${MYSQL_VOLUMES_CONF_DIR}:/etc/mysql/conf.d | ||
- ${MYSQL_VOLUMES_DATA_DIR}:/var/lib/mysql | ||
ports: | ||
- "${MYSQL_PORT}:3306" | ||
|
||
redis: | ||
image: redis:${REDIS_IMAGE_VERSION} | ||
restart: always | ||
networks: | ||
- local_network | ||
command: [ "redis-server", "/usr/local/etc/redis/redis.conf", "--requirepass", $REDIS_PASSWORD ] | ||
volumes: | ||
- ${REDIS_VOLUMES_CONF}:/usr/local/etc/redis/redis.conf | ||
- ${REDIS_VOLUMES_DATA_DIR}:/data | ||
ports: | ||
- ${REDIS_PORT}:6379 | ||
|
||
postgres: | ||
image: postgres:${POSTGRES_IMAGE_VERSION} | ||
restart: always | ||
environment: | ||
POSTGRES_USER: ${POSTGRES_USER} | ||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | ||
POSTGRES_DB: ${POSTGRES_DB} | ||
networks: | ||
- local_network | ||
volumes: | ||
- ${POSTGRES_VOLUMES_DATA_DIR}:/var/lib/postgresql/data | ||
ports: | ||
- ${POSTGRES_PORT}:5432 |
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,10 @@ | ||
[mysqld] | ||
# character-set-server=utf8mb4 | ||
# collation-server=utf8mb4_unicode_ci | ||
default-time-zone='+08:00' | ||
|
||
[mysql] | ||
# default-character-set = utf8 | ||
|
||
[client] | ||
# default-character-set = utf8 |
Oops, something went wrong.