File tree Expand file tree Collapse file tree 3 files changed +5
-1
lines changed
Expand file tree Collapse file tree 3 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ RUN apt-get update && \
66COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
77ENV PYTHONUNBUFFERED=1
88WORKDIR /opt/hackergame
9+ ENV UV_PROJECT_ENVIRONMENT=/usr/local/
910RUN --mount=type=cache,target=/root/.cache/uv \
1011 --mount=type=bind,source=uv.lock,target=uv.lock \
1112 --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
Original file line number Diff line number Diff line change 4141与部署版本不同,该样例** 默认开启了调试模式(环境变量 ` DEBUG ` ),并且允许 hostname 为 localhost 等本地地址** 。
4242
43431 . 复制 ` docker/.env.example ` 到 ` .env ` :` cp docker/.env.example .env ` 。并修改其中的环境变量(为数据库设置密码)。
44+ 1 . 密钥配置:` cp conf/local_settings.py.example conf/local_settings.py ` ,编辑 ` conf/local_settings.py ` ,其中有两条命令,需要执行并把输出贴在相应位置。
44451 . 执行 ` docker compose up ` 启动环境。
45461 . 执行 ` docker exec -it hackergame ./manage.py migrate ` 初始化数据库。
46471 . 执行 ` docker exec -it hackergame ./manage.py collectstatic ` 初始化 Static 目录。
47481 . 执行 ` docker exec -it hackergame ./manage.py setup ` 写入 Google 与 Microsoft app secret。
49+ 1 . 见下方“运行”一节创建管理员账号、导入题目等。
4850
4951### uWSGI 运行模型
5052
Original file line number Diff line number Diff line change @@ -55,7 +55,8 @@ services:
5555 - hackergame-static:/var/opt/hackergame/:ro
5656 - nginx-log:/var/log/nginx/:rw
5757 ports :
58- - 12345:80
58+ # 默认只暴露在本地
59+ - 127.0.0.1:12345:80
5960 depends_on :
6061 - hackergame
6162
You can’t perform that action at this time.
0 commit comments