Skip to content

Commit

Permalink
Update docker-related files
Browse files Browse the repository at this point in the history
  • Loading branch information
taoky committed Aug 12, 2023
1 parent a7f88d8 commit 43dc4d1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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/*

Expand All @@ -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"]
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 支持以下三种方式:
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 43dc4d1

Please sign in to comment.