From 7546c292d9aeca9b4ca339fdff5c4383f2b04fd2 Mon Sep 17 00:00:00 2001 From: tcitry Date: Thu, 25 Sep 2025 12:22:04 +0800 Subject: [PATCH 01/17] fix: replace requestURL in Azure RelayModeRealtime mode. --- relay/channel/openai/adaptor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/relay/channel/openai/adaptor.go b/relay/channel/openai/adaptor.go index 1d8286a43e1..fc4d375b97c 100644 --- a/relay/channel/openai/adaptor.go +++ b/relay/channel/openai/adaptor.go @@ -157,7 +157,8 @@ func (a *Adaptor) GetRequestURL(info *relaycommon.RelayInfo) (string, error) { // https://github.com/songquanpeng/one-api/issues/67 requestURL = fmt.Sprintf("/openai/deployments/%s/%s", model_, task) if info.RelayMode == relayconstant.RelayModeRealtime { - requestURL = fmt.Sprintf("/openai/realtime?deployment=%s&api-version=%s", model_, apiVersion) + // requestURL = fmt.Sprintf("/openai/realtime?deployment=%s&api-version=%s", model_, apiVersion) + requestURL = fmt.Sprintf("/openai/realtime?intent=transcription&api-version=%s", apiVersion) } return relaycommon.GetFullRequestURL(info.ChannelBaseUrl, requestURL, info.ChannelType), nil case constant.ChannelTypeMiniMax: From b3bf27c5ac8d321fb42b75fe52b5b23bc5065cf6 Mon Sep 17 00:00:00 2001 From: tcitry Date: Thu, 25 Sep 2025 15:39:59 +0800 Subject: [PATCH 02/17] chore: expose ports. --- Dockerfile | 1 + docker-compose.yml | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 08cc86f7254..6310b4be848 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,7 @@ ENV GO111MODULE=on \ WORKDIR /build ADD go.mod go.sum ./ +RUN go env -w GOPROXY=https://goproxy.cn,direct RUN go mod download COPY . . diff --git a/docker-compose.yml b/docker-compose.yml index d98fd706e2e..dfc2c3d61c5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,6 +35,8 @@ services: image: redis:latest container_name: redis restart: always + ports: + - "6379:6379" mysql: image: mysql:8.2 @@ -45,8 +47,8 @@ services: MYSQL_DATABASE: new-api volumes: - mysql_data:/var/lib/mysql - # ports: - # - "3306:3306" # If you want to access MySQL from outside Docker, uncomment + ports: + - "3306:3306" # If you want to access MySQL from outside Docker, uncomment volumes: mysql_data: From e70ad5dd0a30d6deee9ed925b408dc1ea6ec0707 Mon Sep 17 00:00:00 2001 From: tcitry Date: Thu, 25 Sep 2025 16:01:02 +0800 Subject: [PATCH 03/17] chore: update image name. --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index dfc2c3d61c5..25f317e8018 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.4' services: new-api: - image: calciumion/new-api:latest + image: lyonapi:latest container_name: new-api restart: always command: --log-dir /app/logs From b4813b2ac04d771e3826852109e00d8f74d6e4f3 Mon Sep 17 00:00:00 2001 From: tcitry Date: Thu, 25 Sep 2025 17:25:41 +0800 Subject: [PATCH 04/17] Revert "chore: expose ports." This reverts commit b3bf27c5ac8d321fb42b75fe52b5b23bc5065cf6. --- Dockerfile | 1 - docker-compose.yml | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6310b4be848..08cc86f7254 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,6 @@ ENV GO111MODULE=on \ WORKDIR /build ADD go.mod go.sum ./ -RUN go env -w GOPROXY=https://goproxy.cn,direct RUN go mod download COPY . . diff --git a/docker-compose.yml b/docker-compose.yml index 25f317e8018..b70d9b407fd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,8 +35,6 @@ services: image: redis:latest container_name: redis restart: always - ports: - - "6379:6379" mysql: image: mysql:8.2 @@ -47,8 +45,8 @@ services: MYSQL_DATABASE: new-api volumes: - mysql_data:/var/lib/mysql - ports: - - "3306:3306" # If you want to access MySQL from outside Docker, uncomment + # ports: + # - "3306:3306" # If you want to access MySQL from outside Docker, uncomment volumes: mysql_data: From e033d4e40a0efc654ae0606c96cb47be0907e9c2 Mon Sep 17 00:00:00 2001 From: tcitry Date: Thu, 25 Sep 2025 17:26:22 +0800 Subject: [PATCH 05/17] chore: fix go build proxy. --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 08cc86f7254..6310b4be848 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,7 @@ ENV GO111MODULE=on \ WORKDIR /build ADD go.mod go.sum ./ +RUN go env -w GOPROXY=https://goproxy.cn,direct RUN go mod download COPY . . From 7b18045395108ad85f892f9f112c2836de78c9a8 Mon Sep 17 00:00:00 2001 From: tcitry Date: Fri, 26 Sep 2025 10:10:12 +0800 Subject: [PATCH 06/17] chore: change default mysql data volumes. --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index b70d9b407fd..fc76459b836 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -44,7 +44,7 @@ services: MYSQL_ROOT_PASSWORD: 123456 # Ensure this matches the password in SQL_DSN MYSQL_DATABASE: new-api volumes: - - mysql_data:/var/lib/mysql + - mysql_data:/data/mysql # ports: # - "3306:3306" # If you want to access MySQL from outside Docker, uncomment From d5a557ca4d076dedfa83628917a290145bf46f57 Mon Sep 17 00:00:00 2001 From: tcitry Date: Fri, 26 Sep 2025 11:19:28 +0800 Subject: [PATCH 07/17] Revert "chore: change default mysql data volumes." This reverts commit 7b18045395108ad85f892f9f112c2836de78c9a8. --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index fc76459b836..b70d9b407fd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -44,7 +44,7 @@ services: MYSQL_ROOT_PASSWORD: 123456 # Ensure this matches the password in SQL_DSN MYSQL_DATABASE: new-api volumes: - - mysql_data:/data/mysql + - mysql_data:/var/lib/mysql # ports: # - "3306:3306" # If you want to access MySQL from outside Docker, uncomment From 55d043fa969a712f92ad0cc0616b97b3e86a5746 Mon Sep 17 00:00:00 2001 From: tcitry Date: Fri, 26 Sep 2025 11:26:43 +0800 Subject: [PATCH 08/17] chore: set new-api mysql volume path. --- docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index b70d9b407fd..a60bd79d53a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -44,9 +44,9 @@ services: MYSQL_ROOT_PASSWORD: 123456 # Ensure this matches the password in SQL_DSN MYSQL_DATABASE: new-api volumes: - - mysql_data:/var/lib/mysql + - /data/new-api/mysql:/var/lib/mysql # ports: # - "3306:3306" # If you want to access MySQL from outside Docker, uncomment -volumes: - mysql_data: +# volumes: +# mysql_data: From a99d7764825427910f80b8d87a26d172809c1512 Mon Sep 17 00:00:00 2001 From: tcitry Date: Fri, 26 Sep 2025 19:53:24 +0800 Subject: [PATCH 09/17] feat: support gpt-realtime & 4o-transcribe --- relay/channel/openai/adaptor.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/relay/channel/openai/adaptor.go b/relay/channel/openai/adaptor.go index fc4d375b97c..28d499850ad 100644 --- a/relay/channel/openai/adaptor.go +++ b/relay/channel/openai/adaptor.go @@ -157,8 +157,12 @@ func (a *Adaptor) GetRequestURL(info *relaycommon.RelayInfo) (string, error) { // https://github.com/songquanpeng/one-api/issues/67 requestURL = fmt.Sprintf("/openai/deployments/%s/%s", model_, task) if info.RelayMode == relayconstant.RelayModeRealtime { - // requestURL = fmt.Sprintf("/openai/realtime?deployment=%s&api-version=%s", model_, apiVersion) - requestURL = fmt.Sprintf("/openai/realtime?intent=transcription&api-version=%s", apiVersion) + // https://techcommunity.microsoft.com/blog/azure-ai-foundry-blog/real-time-speech-transcription-with-gpt-4o-transcribe-and-gpt-4o-mini-transcribe/4410353 + if strings.Contains(requestURL, "intent=transcription") { + requestURL = fmt.Sprintf("/openai/realtime?intent=transcription&api-version=%s", apiVersion) + } else { + requestURL = fmt.Sprintf("/openai/realtime?deployment=%s&api-version=%s", model_, apiVersion) + } } return relaycommon.GetFullRequestURL(info.ChannelBaseUrl, requestURL, info.ChannelType), nil case constant.ChannelTypeMiniMax: From 70c9a21e939ed8fec671eb4cef08eda295ceb756 Mon Sep 17 00:00:00 2001 From: tcitry Date: Fri, 26 Sep 2025 20:17:22 +0800 Subject: [PATCH 10/17] fix: enhance url check. --- relay/channel/openai/adaptor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relay/channel/openai/adaptor.go b/relay/channel/openai/adaptor.go index 28d499850ad..0cf99728c73 100644 --- a/relay/channel/openai/adaptor.go +++ b/relay/channel/openai/adaptor.go @@ -158,7 +158,7 @@ func (a *Adaptor) GetRequestURL(info *relaycommon.RelayInfo) (string, error) { requestURL = fmt.Sprintf("/openai/deployments/%s/%s", model_, task) if info.RelayMode == relayconstant.RelayModeRealtime { // https://techcommunity.microsoft.com/blog/azure-ai-foundry-blog/real-time-speech-transcription-with-gpt-4o-transcribe-and-gpt-4o-mini-transcribe/4410353 - if strings.Contains(requestURL, "intent=transcription") { + if strings.Contains(requestURL, "transcribe") { requestURL = fmt.Sprintf("/openai/realtime?intent=transcription&api-version=%s", apiVersion) } else { requestURL = fmt.Sprintf("/openai/realtime?deployment=%s&api-version=%s", model_, apiVersion) From 838c699fe0b3f0532b8d382b7da2adf6c90dcf3a Mon Sep 17 00:00:00 2001 From: tcitry Date: Thu, 9 Oct 2025 15:46:11 +0800 Subject: [PATCH 11/17] add an individual docker-compose file --- docker-compose.prod.yml | 81 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 docker-compose.prod.yml diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 00000000000..190e9af2099 --- /dev/null +++ b/docker-compose.prod.yml @@ -0,0 +1,81 @@ +# New-API Docker Compose Configuration +# +# Quick Start: +# 1. docker-compose up -d +# 2. Access at http://localhost:3000 +# +# Using MySQL instead of PostgreSQL: +# 1. Comment out the postgres service and SQL_DSN line 15 +# 2. Uncomment the mysql service and SQL_DSN line 16 +# 3. Uncomment mysql in depends_on (line 28) +# 4. Uncomment mysql_data in volumes section (line 64) +# +# ⚠️ IMPORTANT: Change all default passwords before deploying to production! + +version: '3.4' # For compatibility with older Docker versions + +services: + new-api: + image: lyonapi:latest + container_name: new-api + restart: always + command: --log-dir /app/logs + ports: + - "3000:3000" + volumes: + - ./data:/data + - ./logs:/app/logs + environment: + - SQL_DSN=postgresql://root:123456@postgres:5432/new-api # ⚠️ IMPORTANT: Change the password in production! +# - SQL_DSN=root:123456@tcp(mysql:3306)/new-api # Point to the mysql service, uncomment if using MySQL + - REDIS_CONN_STRING=redis://redis + - TZ=Asia/Shanghai + - ERROR_LOG_ENABLED=true # 是否启用错误日志记录 + - BATCH_UPDATE_ENABLED=true # 是否启用批量更新 batch update enabled +# - STREAMING_TIMEOUT=300 # 流模式无响应超时时间,单位秒,默认120秒,如果出现空补全可以尝试改为更大值 Streaming timeout in seconds, default is 120s. Increase if experiencing empty completions +# - SESSION_SECRET=random_string # 多机部署时设置,必须修改这个随机字符串!! multi-node deployment, set this to a random string!!!!!!! +# - SYNC_FREQUENCY=60 # Uncomment if regular database syncing is needed + + depends_on: + - redis + - postgres +# - mysql # Uncomment if using MySQL + healthcheck: + test: ["CMD-SHELL", "wget -q -O - http://localhost:3000/api/status | grep -o '\"success\":\\s*true' || exit 1"] + interval: 30s + timeout: 10s + retries: 3 + + redis: + image: redis:latest + container_name: redis + restart: always + + postgres: + image: postgres:15 + container_name: postgres + restart: always + environment: + POSTGRES_USER: root + POSTGRES_PASSWORD: 123456 # ⚠️ IMPORTANT: Change this password in production! + POSTGRES_DB: new-api + volumes: + - /data/new-api/pg:/var/lib/postgresql/data + ports: + - "5432:5432" # Uncomment if you need to access PostgreSQL from outside Docker + +# mysql: +# image: mysql:8.2 +# container_name: mysql +# restart: always +# environment: +# MYSQL_ROOT_PASSWORD: 123456 # ⚠️ IMPORTANT: Change this password in production! +# MYSQL_DATABASE: new-api +# volumes: +# - mysql_data:/var/lib/mysql +# ports: +# - "3306:3306" # Uncomment if you need to access MySQL from outside Docker + +# volumes: +# pg_data: +# mysql_data: From 1e52addc536376f91ec2bbd7b72b5da895865867 Mon Sep 17 00:00:00 2001 From: tcitry Date: Thu, 9 Oct 2025 15:48:05 +0800 Subject: [PATCH 12/17] update container_name to avoid conflict. --- docker-compose.prod.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 190e9af2099..1327876b1b1 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -48,12 +48,12 @@ services: redis: image: redis:latest - container_name: redis + container_name: new-api-redis restart: always postgres: image: postgres:15 - container_name: postgres + container_name: new-api-postgres restart: always environment: POSTGRES_USER: root From a0c8e0bf3f68098a6b872dcf9312491944f3f193 Mon Sep 17 00:00:00 2001 From: tcitry Date: Thu, 9 Oct 2025 15:54:25 +0800 Subject: [PATCH 13/17] update container name --- docker-compose.prod.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 1327876b1b1..3ec0b8a38e6 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -17,7 +17,7 @@ version: '3.4' # For compatibility with older Docker versions services: new-api: image: lyonapi:latest - container_name: new-api + container_name: lyonapi restart: always command: --log-dir /app/logs ports: @@ -48,12 +48,12 @@ services: redis: image: redis:latest - container_name: new-api-redis + container_name: lyonapi-redis restart: always postgres: image: postgres:15 - container_name: new-api-postgres + container_name: lyonapi-postgres restart: always environment: POSTGRES_USER: root From 42cec8e6d2af3a162c539b2e8baada53b9398734 Mon Sep 17 00:00:00 2001 From: tcitry Date: Thu, 9 Oct 2025 16:00:38 +0800 Subject: [PATCH 14/17] update port --- docker-compose.prod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 3ec0b8a38e6..d9cc607e06d 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -21,7 +21,7 @@ services: restart: always command: --log-dir /app/logs ports: - - "3000:3000" + - "8000:3000" volumes: - ./data:/data - ./logs:/app/logs From 6a83ee74c1a2acbd793d4b843189d0a67de4c140 Mon Sep 17 00:00:00 2001 From: tcitry Date: Thu, 9 Oct 2025 16:02:27 +0800 Subject: [PATCH 15/17] update port --- docker-compose.prod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index d9cc607e06d..29aa009c5b7 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -21,7 +21,7 @@ services: restart: always command: --log-dir /app/logs ports: - - "8000:3000" + - "8080:3000" volumes: - ./data:/data - ./logs:/app/logs From 808f359a774f9c415adfc2f5af257d317df2aa98 Mon Sep 17 00:00:00 2001 From: tcitry Date: Thu, 9 Oct 2025 16:36:18 +0800 Subject: [PATCH 16/17] update port --- docker-compose.prod.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 29aa009c5b7..51f117b1b1e 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -21,7 +21,7 @@ services: restart: always command: --log-dir /app/logs ports: - - "8080:3000" + - "3030:3000" volumes: - ./data:/data - ./logs:/app/logs @@ -61,8 +61,8 @@ services: POSTGRES_DB: new-api volumes: - /data/new-api/pg:/var/lib/postgresql/data - ports: - - "5432:5432" # Uncomment if you need to access PostgreSQL from outside Docker +# ports: +# - "5432:5432" # Uncomment if you need to access PostgreSQL from outside Docker # mysql: # image: mysql:8.2 From c2b027a69eda818f69b9bc92758f8bd61151c36f Mon Sep 17 00:00:00 2001 From: tcitry Date: Fri, 10 Oct 2025 12:04:30 +0800 Subject: [PATCH 17/17] use mysql --- docker-compose.dev.yml | 82 +++++++++++++++++++++++++++++++++++++++++ docker-compose.prod.yml | 52 +++++++++++++------------- 2 files changed, 108 insertions(+), 26 deletions(-) create mode 100644 docker-compose.dev.yml diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml new file mode 100644 index 00000000000..9c05c4e36ed --- /dev/null +++ b/docker-compose.dev.yml @@ -0,0 +1,82 @@ +# New-API Docker Compose Configuration +# +# Quick Start: +# 1. docker-compose up -d +# 2. Access at http://localhost:3000 +# +# Using MySQL instead of PostgreSQL: +# 1. Comment out the postgres service and SQL_DSN line 15 +# 2. Uncomment the mysql service and SQL_DSN line 16 +# 3. Uncomment mysql in depends_on (line 28) +# 4. Uncomment mysql_data in volumes section (line 64) +# +# ⚠️ IMPORTANT: Change all default passwords before deploying to production! + +version: '3.4' # For compatibility with older Docker versions + +services: + new-api: + image: lyonapi:latest + container_name: lyonapi + restart: always + command: --log-dir /app/logs + ports: + - "3000:3000" + volumes: + - ./data:/data + - ./logs:/app/logs + environment: + # - SQL_DSN=postgresql://root:123456@postgres:5432/new-api # ⚠️ IMPORTANT: Change the password in production! + - SQL_DSN=root:123456@tcp(mysql:3306)/new-api # Point to the mysql service, uncomment if using MySQL + - REDIS_CONN_STRING=redis://redis + - TZ=Asia/Shanghai + - ERROR_LOG_ENABLED=true # 是否启用错误日志记录 + - BATCH_UPDATE_ENABLED=true # 是否启用批量更新 batch update enabled +# - STREAMING_TIMEOUT=300 # 流模式无响应超时时间,单位秒,默认120秒,如果出现空补全可以尝试改为更大值 Streaming timeout in seconds, default is 120s. Increase if experiencing empty completions +# - SESSION_SECRET=random_string # 多机部署时设置,必须修改这个随机字符串!! multi-node deployment, set this to a random string!!!!!!! +# - SYNC_FREQUENCY=60 # Uncomment if regular database syncing is needed + + depends_on: + - redis + - mysql + # - postgres + + healthcheck: + test: ["CMD-SHELL", "wget -q -O - http://localhost:3000/api/status | grep -o '\"success\":\\s*true' || exit 1"] + interval: 30s + timeout: 10s + retries: 3 + + redis: + image: redis:latest + container_name: lyonapi-redis + restart: always + + # postgres: + # image: postgres:15 + # container_name: lyonapi-postgres + # restart: always + # environment: + # POSTGRES_USER: root + # POSTGRES_PASSWORD: 123456 # ⚠️ IMPORTANT: Change this password in production! + # POSTGRES_DB: new-api + # volumes: + # - /data/new-api/pg:/var/lib/postgresql/data + # ports: + # - "5432:5432" # Uncomment if you need to access PostgreSQL from outside Docker + + mysql: + image: mysql:8.2 + container_name: lyonapi-mysql + restart: always + environment: + MYSQL_ROOT_PASSWORD: 123456 # ⚠️ IMPORTANT: Change this password in production! + MYSQL_DATABASE: new-api + volumes: + - /data/new-api/mysql:/var/lib/mysql + # ports: + # - "3306:3306" # Uncomment if you need to access MySQL from outside Docker + +# volumes: + # pg_data: + # mysql_data: diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 51f117b1b1e..c901edf75a9 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -26,8 +26,8 @@ services: - ./data:/data - ./logs:/app/logs environment: - - SQL_DSN=postgresql://root:123456@postgres:5432/new-api # ⚠️ IMPORTANT: Change the password in production! -# - SQL_DSN=root:123456@tcp(mysql:3306)/new-api # Point to the mysql service, uncomment if using MySQL + # - SQL_DSN=postgresql://root:123456@postgres:5432/new-api # ⚠️ IMPORTANT: Change the password in production! + - SQL_DSN=root:123456@tcp(mysql:3306)/new-api # Point to the mysql service, uncomment if using MySQL - REDIS_CONN_STRING=redis://redis - TZ=Asia/Shanghai - ERROR_LOG_ENABLED=true # 是否启用错误日志记录 @@ -38,8 +38,8 @@ services: depends_on: - redis - - postgres -# - mysql # Uncomment if using MySQL + # - postgres + - mysql # Uncomment if using MySQL healthcheck: test: ["CMD-SHELL", "wget -q -O - http://localhost:3000/api/status | grep -o '\"success\":\\s*true' || exit 1"] interval: 30s @@ -51,31 +51,31 @@ services: container_name: lyonapi-redis restart: always - postgres: - image: postgres:15 - container_name: lyonapi-postgres - restart: always - environment: - POSTGRES_USER: root - POSTGRES_PASSWORD: 123456 # ⚠️ IMPORTANT: Change this password in production! - POSTGRES_DB: new-api - volumes: - - /data/new-api/pg:/var/lib/postgresql/data + # postgres: + # image: postgres:15 + # container_name: lyonapi-postgres + # restart: always + # environment: + # POSTGRES_USER: root + # POSTGRES_PASSWORD: 123456 # ⚠️ IMPORTANT: Change this password in production! + # POSTGRES_DB: new-api + # volumes: + # - /data/new-api/pg:/var/lib/postgresql/data # ports: # - "5432:5432" # Uncomment if you need to access PostgreSQL from outside Docker -# mysql: -# image: mysql:8.2 -# container_name: mysql -# restart: always -# environment: -# MYSQL_ROOT_PASSWORD: 123456 # ⚠️ IMPORTANT: Change this password in production! -# MYSQL_DATABASE: new-api -# volumes: -# - mysql_data:/var/lib/mysql -# ports: -# - "3306:3306" # Uncomment if you need to access MySQL from outside Docker + mysql: + image: mysql:8.2 + container_name: mysql + restart: always + environment: + MYSQL_ROOT_PASSWORD: 123456 # ⚠️ IMPORTANT: Change this password in production! + MYSQL_DATABASE: new-api + volumes: + - /data/new-api/mysql:/var/lib/mysql + # ports: + # - "3306:3306" # Uncomment if you need to access MySQL from outside Docker # volumes: # pg_data: -# mysql_data: +# mysql_data: