diff --git a/.gitignore b/.gitignore index 2f59367..606e862 100644 --- a/.gitignore +++ b/.gitignore @@ -154,4 +154,4 @@ cython_debug/ /dict/* tester.py /config/db.json -/dict/README.md \ No newline at end of file +/dict/README.md diff --git a/Dockerfile-big b/Dockerfile-big deleted file mode 100644 index a6512f7..0000000 --- a/Dockerfile-big +++ /dev/null @@ -1,7 +0,0 @@ -FROM python:3.11 -WORKDIR /code -ADD . /code -RUN pip install -r /code/requirements.txt -RUN pyinstaller -F main.py -EXPOSE 8000 -ENTRYPOINT ["./main"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9914337 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,26 @@ +version: '3.8' + +services: + fastapi-app: + build: + context: . + dockerfile: Dockerfile + target: runtime + image: snap-hutao-generic-api:latest + container_name: Snap-Hutao-Generic-API + ports: + - "3975:8080" + volumes: + - ./cache:/app/cache + - ./.env:/app/.env + restart: unless-stopped + depends_on: + - tunnel + + tunnel: + container_name: Snap-Hutao-Generic-API-Tunnel + image: cloudflare/cloudflared:latest + restart: unless-stopped + command: tunnel --no-autoupdate run + environment: + - TUNNEL_TOKEN=snap-hutao-generic-api-tunnel-token \ No newline at end of file