mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
docker: update instructions
This commit is contained in:
1 parent
3e7306e232
commit
b32e7b53ec
5 files changed
+14
-21
No files matched your search
@@ -1,5 +1,6 @@
|
||||
FROM node:14
|
||||
ADD ./entrypoint.sh /root/entrypoint.sh
|
||||
RUN yarn global add pm2 hydrooj @hydrooj/ui-default
|
||||
RUN chmod +x /root/entrypoint.sh
|
||||
RUN chmod +x /root/entrypoint.sh && \
|
||||
mkdir -p /root/.hydro
|
||||
ENTRYPOINT /root/entrypoint.sh
|
||||
@@ -1,22 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
ROOT=/root/.hydro
|
||||
mkdir -p $ROOT
|
||||
|
||||
if [ ! -f "$ROOT/addon.json" ]; then
|
||||
echo '["@hydrooj/ui-default"]' > "$ROOT/addon.json"
|
||||
fi
|
||||
|
||||
if [ ! -f "$ROOT/config.json" ]; then
|
||||
# TODO 变成变量
|
||||
echo '{"host": "oj-mongo", "port": "27017", "name": "hydro", "username": "", "password": ""}' > "$ROOT/config.json"
|
||||
fi
|
||||
|
||||
if [ ! -f "$ROOT/first" ]; then
|
||||
echo "for marking use only!" > "$ROOT/first"
|
||||
hydrooj cli system set file.accessKey "$ACCESS_KEY"
|
||||
hydrooj cli system set file.secretKey "$SECRET_KEY"
|
||||
# TODO 变成变量
|
||||
hydrooj cli system set file.endPoint http://oj-minio:9000/
|
||||
|
||||
hydrooj cli user create systemjudge@systemjudge.local root rootroot
|
||||
|
||||
@@ -12,6 +12,8 @@ services:
|
||||
- MINIO_ACCESS_KEY=CHANGE_THIS
|
||||
- MINIO_SECRET_KEY=CHANGE_THIS
|
||||
|
||||
# Warning: mongodb here is not password-protected.
|
||||
# DO NOT EXPOSE THIS SERVICE TO THE PUBLIC.
|
||||
oj-mongo:
|
||||
image: mongo
|
||||
container_name: oj-mongo
|
||||
@@ -27,12 +29,12 @@ services:
|
||||
- oj-minio
|
||||
- oj-mongo
|
||||
volumes:
|
||||
- ./data/backend/config:/root/.hydro
|
||||
- ./data/backend:/root/.hydro
|
||||
environment:
|
||||
- ACCESS_KEY=CHANGE_THIS
|
||||
- SECRET_KEY=CHANGE_THIS
|
||||
- MINIO_ACCESS_KEY=CHANGE_THIS
|
||||
- MINIO_SECRET_KEY=CHANGE_THIS
|
||||
ports:
|
||||
- "0.0.0.0:80:8888"
|
||||
- "0.0.0.0:80:8888" # In docker mode, change THIS port instead of port in system settings!
|
||||
|
||||
oj-judge:
|
||||
build: ./judge
|
||||
@@ -42,4 +44,4 @@ services:
|
||||
depends_on:
|
||||
- oj-backend
|
||||
volumes:
|
||||
- ./data/judge/config:/root/.config/hydro
|
||||
- ./data/judge:/root/.config/hydro
|
||||
@@ -1,9 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
ROOT=/root/.config/hydro
|
||||
mkdir -p $ROOT
|
||||
if [ ! -f "$ROOT/judge.yaml" ]; then
|
||||
cp /root/judge.yaml $ROOT
|
||||
fi
|
||||
pm2 start sandbox
|
||||
pm2-runtime start hydrojudge
|
||||
@@ -1,7 +1,7 @@
|
||||
hosts:
|
||||
localhost:
|
||||
type: hydro # vj4 用户请在此处填写 vj4
|
||||
server_url: http://oj-backend:8888/ # Hydro 运行的网址
|
||||
uname: root # 评测账号用户名
|
||||
password: rootroot # 评测账号密码
|
||||
detail: true # 默认为 true
|
||||
type: hydro
|
||||
server_url: http://oj-backend:8888/
|
||||
uname: root
|
||||
password: rootroot
|
||||
detail: true
|
||||
Reference in new issue
Block a user