创建程序目录结构;实现docker启动postgres和redis

This commit is contained in:
jayhgq 2026-02-23 14:11:45 +08:00
parent 53f590fed0
commit 1edf19be4b
1276 changed files with 1352 additions and 0 deletions

0
backend/auth/Dockerfile Normal file
View File

20
docker-compose/.env Normal file
View File

@ -0,0 +1,20 @@
COMPOSE_PROJECT_NAME=booksystem
# 通用设置
# 容器内数据映射根目录,注意最后不要带斜杆
CONTAINER_BASE_PATH=/home/booksystem
# 数据库信息
DB_USER=admin
DB_PASSWORD=PostgresAdmin@123
DB_NAME=booksystem
DB_PORT=5432
DB_DATA_PATH=../postgres_data
# Redis信息
REDIS_PORT=6379
REDIS_PASSWORD=RedisAdmin@123
# 端口信息
AUTH_PORT=8000
FRONTEND_PORT=3000

View File

@ -0,0 +1,52 @@
version: '3.8'
services:
# 数据库
postgres:
image: postgres:17
container_name: bs-postgres
restart: always
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
ports:
- "${DB_PORT}:5432"
volumes:
- ${DB_DATA_PATH}:${CONTAINER_BASE_PATH}/postgresql/data #此处使用主机的实际路径不用再写顶层的volumes
networks:
- bs-network
# redis
redis:
image: redis:8.4.1-alpine
container_name: bs-redis
restart: always
ports:
- "${REDIS_PORT}:6379"
command: >
redis-server
--requirepass ${REDIS_PASSWORD}
--dir ${CONTAINER_BASE_PATH}/data
--logfile ${CONTAINER_BASE_PATH}/redis/logs/redis-server.log
environment:
- TZ=Asia/Shanghai
volumes:
# 数据持久化:宿主机路径 -> 容器/dataRedis默认数据目录
- type: bind
source: ../redis/data
target: ${CONTAINER_BASE_PATH}/data/
bind:
create_host_path: true # 自动创建宿主机目录(无需手动建)
# 日志挂载:宿主机路径 -> 容器日志目录
- type: bind
source: ../redis/logs
target: ${CONTAINER_BASE_PATH}/redis/logs/
bind:
create_host_path: true # 自动创建日志目录
networks:
- bs-network
networks:
bs-network:
driver: bridge

1
postgres_data/PG_VERSION Normal file
View File

@ -0,0 +1 @@
17

BIN
postgres_data/base/1/112 Normal file

Binary file not shown.

BIN
postgres_data/base/1/113 Normal file

Binary file not shown.

BIN
postgres_data/base/1/1247 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
postgres_data/base/1/1249 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
postgres_data/base/1/1255 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
postgres_data/base/1/1259 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
postgres_data/base/1/13466 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

BIN
postgres_data/base/1/13470 Normal file

Binary file not shown.

BIN
postgres_data/base/1/13471 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

BIN
postgres_data/base/1/13475 Normal file

Binary file not shown.

BIN
postgres_data/base/1/13476 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

BIN
postgres_data/base/1/13480 Normal file

Binary file not shown.

BIN
postgres_data/base/1/13481 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

BIN
postgres_data/base/1/13485 Normal file

Binary file not shown.

View File

View File

BIN
postgres_data/base/1/174 Normal file

Binary file not shown.

BIN
postgres_data/base/1/175 Normal file

Binary file not shown.

BIN
postgres_data/base/1/2187 Normal file

Binary file not shown.

View File

BIN
postgres_data/base/1/2228 Normal file

Binary file not shown.

View File

View File

BIN
postgres_data/base/1/2337 Normal file

Binary file not shown.

BIN
postgres_data/base/1/2579 Normal file

Binary file not shown.

BIN
postgres_data/base/1/2600 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
postgres_data/base/1/2601 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
postgres_data/base/1/2602 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
postgres_data/base/1/2603 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

BIN
postgres_data/base/1/2605 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
postgres_data/base/1/2606 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
postgres_data/base/1/2607 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
postgres_data/base/1/2608 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
postgres_data/base/1/2609 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
postgres_data/base/1/2610 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

BIN
postgres_data/base/1/2612 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

BIN
postgres_data/base/1/2615 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
postgres_data/base/1/2616 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
postgres_data/base/1/2617 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
postgres_data/base/1/2618 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
postgres_data/base/1/2619 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More