mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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
|
FROM node:14
|
||||||
ADD ./entrypoint.sh /root/entrypoint.sh
|
ADD ./entrypoint.sh /root/entrypoint.sh
|
||||||
RUN yarn global add pm2 hydrooj @hydrooj/ui-default
|
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
|
ENTRYPOINT /root/entrypoint.sh
|
||||||
@@ -1,22 +1,17 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
ROOT=/root/.hydro
|
ROOT=/root/.hydro
|
||||||
mkdir -p $ROOT
|
|
||||||
|
|
||||||
if [ ! -f "$ROOT/addon.json" ]; then
|
if [ ! -f "$ROOT/addon.json" ]; then
|
||||||
echo '["@hydrooj/ui-default"]' > "$ROOT/addon.json"
|
echo '["@hydrooj/ui-default"]' > "$ROOT/addon.json"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "$ROOT/config.json" ]; then
|
if [ ! -f "$ROOT/config.json" ]; then
|
||||||
# TODO 变成变量
|
|
||||||
echo '{"host": "oj-mongo", "port": "27017", "name": "hydro", "username": "", "password": ""}' > "$ROOT/config.json"
|
echo '{"host": "oj-mongo", "port": "27017", "name": "hydro", "username": "", "password": ""}' > "$ROOT/config.json"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "$ROOT/first" ]; then
|
if [ ! -f "$ROOT/first" ]; then
|
||||||
echo "for marking use only!" > "$ROOT/first"
|
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 system set file.endPoint http://oj-minio:9000/
|
||||||
|
|
||||||
hydrooj cli user create systemjudge@systemjudge.local root rootroot
|
hydrooj cli user create systemjudge@systemjudge.local root rootroot
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ services:
|
|||||||
- MINIO_ACCESS_KEY=CHANGE_THIS
|
- MINIO_ACCESS_KEY=CHANGE_THIS
|
||||||
- MINIO_SECRET_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:
|
oj-mongo:
|
||||||
image: mongo
|
image: mongo
|
||||||
container_name: oj-mongo
|
container_name: oj-mongo
|
||||||
@@ -27,12 +29,12 @@ services:
|
|||||||
- oj-minio
|
- oj-minio
|
||||||
- oj-mongo
|
- oj-mongo
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/backend/config:/root/.hydro
|
- ./data/backend:/root/.hydro
|
||||||
environment:
|
environment:
|
||||||
- ACCESS_KEY=CHANGE_THIS
|
- MINIO_ACCESS_KEY=CHANGE_THIS
|
||||||
- SECRET_KEY=CHANGE_THIS
|
- MINIO_SECRET_KEY=CHANGE_THIS
|
||||||
ports:
|
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:
|
oj-judge:
|
||||||
build: ./judge
|
build: ./judge
|
||||||
@@ -42,4 +44,4 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- oj-backend
|
- oj-backend
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/judge/config:/root/.config/hydro
|
- ./data/judge:/root/.config/hydro
|
||||||
@@ -1,9 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/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 start sandbox
|
||||||
pm2-runtime start hydrojudge
|
pm2-runtime start hydrojudge
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
hosts:
|
hosts:
|
||||||
localhost:
|
localhost:
|
||||||
type: hydro # vj4 用户请在此处填写 vj4
|
type: hydro
|
||||||
server_url: http://oj-backend:8888/ # Hydro 运行的网址
|
server_url: http://oj-backend:8888/
|
||||||
uname: root # 评测账号用户名
|
uname: root
|
||||||
password: rootroot # 评测账号密码
|
password: rootroot
|
||||||
detail: true # 默认为 true
|
detail: true
|
||||||
Reference in new issue
Block a user