ci: add docker-compose example yml

This commit is contained in:
xtaodada 2024-05-16 21:05:19 +08:00
parent 3de12c1de7
commit d3246af110
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
4 changed files with 30 additions and 1 deletions

View File

@ -7,6 +7,10 @@ on:
push: push:
branches: branches:
- main - main
paths:
- 'Dockerfile'
- '.gitea/workflows/**'
- '**.py'
jobs: jobs:
build: build:

1
.gitignore vendored
View File

@ -162,3 +162,4 @@ cython_debug/
# cache # cache
cache/ cache/
data/ data/
docker-compose.yml

View File

@ -0,0 +1,24 @@
version: '3'
services:
fixmiyoushe:
image: paigramteam/fixmiyoushe:latest
container_name: fixmiyoushe
restart: always
ports:
- 127.0.0.1:${PORT}:${PORT}
environment:
- TZ=Asia/Shanghai
- DEBUG=${DEBUG}
- DOMAIN=${DOMAIN}
- PORT=${PORT}
- MIYOUSHE=${MIYOUSHE}
- HOYOLAB=${HOYOLAB}
- BOT=${BOT}
- BOT_API_ID=${BOT_API_ID}
- BOT_API_HASH=${BOT_API_HASH}
- BOT_TOKEN=${BOT_TOKEN}
- MIYOUSHE_HOST=${MIYOUSHE_HOST}
- HOYOLAB_HOST=${HOYOLAB_HOST}
- USER_AGENT=${USER_AGENT}
volumes:
- ./data:/usr/app/data

View File

@ -35,7 +35,7 @@ class Web:
async def start(self): async def start(self):
self.init_web() self.init_web()
self.web_server = uvicorn.Server( self.web_server = uvicorn.Server(
config=uvicorn.Config(app, host="127.0.0.1", port=PORT) config=uvicorn.Config(app, host="0.0.0.0", port=PORT)
) )
server_config = self.web_server.config server_config = self.web_server.config
server_config.setup_event_loop() server_config.setup_event_loop()