w: add docker installation (#152)

This commit is contained in:
zhoupb12313 authored and GitHub committed 2021-06-04 21:31:00 +08:00
1 parent 715e564971
commit 7b75a961bc
7 files changed
+174

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
FROM node:14
ADD ./entrypoint.sh /root/entrypoint.sh
RUN yarn global add pm2 hydrooj @hydrooj/ui-default
RUN chmod +x /root/entrypoint.sh
ENTRYPOINT /root/entrypoint.sh
+27
View File
@@ -0,0 +1,27 @@
#!/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
hydrooj cli user setSuperAdmin 2
fi
pm2-runtime start hydrooj