forked from cxykevin/sacn_accout_system
完成docker
This commit is contained in:
parent
987cd9ec9e
commit
c65f0bf66c
|
@ -0,0 +1,4 @@
|
|||
*/__pycache__/**
|
||||
venv
|
||||
config.toml
|
||||
config
|
|
@ -0,0 +1,11 @@
|
|||
FROM python:3.12-slim
|
||||
|
||||
COPY . /auth
|
||||
|
||||
WORKDIR /auth
|
||||
|
||||
RUN pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["python", "main.py"]
|
|
@ -0,0 +1,7 @@
|
|||
services:
|
||||
auth:
|
||||
build: .
|
||||
ports:
|
||||
- "8000:8000"
|
||||
volumes:
|
||||
- ./config:/auth/config
|
|
@ -1,10 +1,11 @@
|
|||
import tomllib
|
||||
import os
|
||||
|
||||
with open("config.toml", "rb") as f:
|
||||
with open("config/config.toml", "rb") as f:
|
||||
config = tomllib.load(f)
|
||||
|
||||
|
||||
def reload():
|
||||
global config
|
||||
with open("config.toml", "rb") as f:
|
||||
with open("config/config.toml", "rb") as f:
|
||||
config = tomllib.load(f)
|
||||
|
|
Loading…
Reference in New Issue