Skip to content

Commit 8c334be

Browse files
committed
Fix uv env
1 parent 53499e5 commit 8c334be

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ RUN apt-get update && \
66
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
77
ENV PYTHONUNBUFFERED=1
88
WORKDIR /opt/hackergame
9+
ENV UV_PROJECT_ENVIRONMENT=/usr/local/
910
RUN --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 \

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@
4141
与部署版本不同,该样例**默认开启了调试模式(环境变量 `DEBUG`),并且允许 hostname 为 localhost 等本地地址**
4242

4343
1. 复制 `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`,其中有两条命令,需要执行并把输出贴在相应位置。
4445
1. 执行 `docker compose up` 启动环境。
4546
1. 执行 `docker exec -it hackergame ./manage.py migrate` 初始化数据库。
4647
1. 执行 `docker exec -it hackergame ./manage.py collectstatic` 初始化 Static 目录。
4748
1. 执行 `docker exec -it hackergame ./manage.py setup` 写入 Google 与 Microsoft app secret。
49+
1. 见下方“运行”一节创建管理员账号、导入题目等。
4850

4951
### uWSGI 运行模型
5052

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)