From 43dc4d1e2386a5de356686849a5c97df2d575bb2 Mon Sep 17 00:00:00 2001 From: taoky Date: Sat, 12 Aug 2023 23:29:04 +0800 Subject: [PATCH] Update docker-related files --- Dockerfile | 5 ++--- README.md | 2 ++ docker-compose.yml | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9717d5e..74b0429 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ -FROM python:3.9 +FROM python:3.11 RUN apt-get update && \ - apt-get -y install uwsgi-plugin-python3 && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* @@ -11,4 +10,4 @@ COPY requirements.txt /opt/hackergame/ RUN pip3 install --upgrade -r requirements.txt COPY ./ /opt/hackergame/ -CMD ["/usr/bin/uwsgi", "--master", "--ini", "conf/uwsgi-apps/hackergame-docker.ini"] +CMD ["/usr/local/bin/uwsgi", "--master", "--ini", "conf/uwsgi.ini", "--ini", "conf/uwsgi-apps/hackergame-docker.ini"] diff --git a/README.md b/README.md index a41c32b..6619795 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ 1. Nginx 配置文件:`cp conf/nginx-sites/hackergame /etc/nginx/sites-available/hackergame`,`ln -s /etc/nginx/sites-available/hackergame /etc/nginx/sites-enabled/hackergame`,`systemctl reload nginx`。 1. 其他配置文件:`cp conf/pgbouncer.ini /etc/pgbouncer/`, `systemctl reload pgbouncer`。 +另外我们提供 docker compose 样例,但是实际部署不使用该容器版本。 + ### uWSGI 运行模型 uWSGI 支持以下三种方式: diff --git a/docker-compose.yml b/docker-compose.yml index 9f292e6..0ab776e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,9 +11,10 @@ services: volumes: - ./conf/local_settings.py:/opt/hackergame/conf/local_settings.py:ro - ./conf/settings/docker.py:/opt/hackergame/conf/settings/docker.py:ro - - ./conf/nudt-allowlist.txt:/opt/hackergame/conf/nudt-allowlist.txt:ro - /run/uwsgi/app/hackergame/:/run/uwsgi/app/hackergame/ + # 存储静态网页与题目文件 - /var/opt/hackergame/:/var/opt/hackergame/ + # 数据库,需要在容器外配置好 postgresql 和 pgbouncer - /var/run/postgresql/:/var/run/postgresql/ depends_on: - memcached