feat: support persistent data in docker, using docker volume

This commit is contained in:
Ou
2025-05-11 00:55:41 +08:00
parent 10f5d9a53d
commit 9f1be628e0
2 changed files with 28 additions and 1 deletions
+19
View File
@@ -0,0 +1,19 @@
version: '3'
services:
newsnow:
build: .
ports:
- '4444:4444'
volumes:
- newsnow_data:/usr/app/.data
environment:
- G_CLIENT_ID=
- G_CLIENT_SECRET=
- JWT_SECRET=
- INIT_TABLE=true
- ENABLE_CACHE=true
volumes:
newsnow_data:
name: newsnow_data
+9 -1
View File
@@ -4,12 +4,20 @@ services:
newsnow:
image: ghcr.io/ourongxing/newsnow:latest
container_name: newsnow
restart: always
ports:
- '4444:4444'
volumes:
- newsnow_data:/usr/app/.data
environment:
- HOST=0.0.0.0
- PORT=4444
- NODE_ENV=production
- G_CLIENT_ID=
- G_CLIENT_SECRET=
- JWT_SECRET=
- INIT_TABLE=true
- ENABLE_CACHE=true
volumes:
newsnow_data:
name: newsnow_data