Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
16b8469c
authored
Nov 23, 2024
by
CalciumIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: Update docker-compose.yml
parent
15ce5347
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
docker-compose.yml
+20
-5
No files found.
docker-compose.yml
View file @
16b8469c
...
@@ -3,7 +3,6 @@ version: '3.4'
...
@@ -3,7 +3,6 @@ version: '3.4'
services
:
services
:
new-api
:
new-api
:
image
:
calciumion/new-api:latest
image
:
calciumion/new-api:latest
# build: .
container_name
:
new-api
container_name
:
new-api
restart
:
always
restart
:
always
command
:
--log-dir /app/logs
command
:
--log-dir /app/logs
...
@@ -13,16 +12,17 @@ services:
...
@@ -13,16 +12,17 @@ services:
-
./data:/data
-
./data:/data
-
./logs:/app/logs
-
./logs:/app/logs
environment
:
environment
:
-
SQL_DSN=root:123456@tcp(
host.docker.internal:3306)/new-api
# 修改此行,或注释掉以使用 SQLite 作为数据库
-
SQL_DSN=root:123456@tcp(
mysql:3306)/new-api
# Point to the mysql service
-
REDIS_CONN_STRING=redis://redis
-
REDIS_CONN_STRING=redis://redis
-
SESSION_SECRET=random_string
# 修改为随机字符串
-
SESSION_SECRET=random_string
# 修改为随机字符串
-
TZ=Asia/Shanghai
-
TZ=Asia/Shanghai
# - NODE_TYPE=slave # 多机部署时从节点取消注释该行
# - NODE_TYPE=slave # Uncomment for slave node in multi-node deployment
# - SYNC_FREQUENCY=60 # 需要定期从数据库加载数据时取消注释该行
# - SYNC_FREQUENCY=60 # Uncomment if regular database syncing is needed
# - FRONTEND_BASE_URL=https://openai.justsong.cn # 多机部署时从节点取消注释该行
# - FRONTEND_BASE_URL=https://openai.justsong.cn # Uncomment for multi-node deployment with front-end URL
depends_on
:
depends_on
:
-
redis
-
redis
-
mysql
healthcheck
:
healthcheck
:
test
:
[
"
CMD-SHELL"
,
"
wget
-q
-O
-
http://localhost:3000/api/status
|
grep
-o
'
\"
success
\"
:
\\
s*true'
|
awk
-F:
'{print
$2}'"
]
test
:
[
"
CMD-SHELL"
,
"
wget
-q
-O
-
http://localhost:3000/api/status
|
grep
-o
'
\"
success
\"
:
\\
s*true'
|
awk
-F:
'{print
$2}'"
]
interval
:
30s
interval
:
30s
...
@@ -33,3 +33,18 @@ services:
...
@@ -33,3 +33,18 @@ services:
image
:
redis:latest
image
:
redis:latest
container_name
:
redis
container_name
:
redis
restart
:
always
restart
:
always
mysql
:
image
:
mysql:8.2
container_name
:
mysql
restart
:
always
environment
:
MYSQL_ROOT_PASSWORD
:
123456
# Ensure this matches the password in SQL_DSN
MYSQL_DATABASE
:
new-api
volumes
:
-
mysql_data:/var/lib/mysql
ports
:
-
"
3306:3306"
# If you want to access MySQL from outside Docker, uncomment
volumes
:
mysql_data
:
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment