Commit 58ba4905 authored by nanahira's avatar nanahira

test new docker

parent 7e1552e0
# Dockerfile for SRVPro
FROM node:stretch FROM node:stretch
RUN ssh-keygen -A # apt
RUN apt update RUN apt update
RUN apt install -y openssh-server locales curl git vim build-essential premake4 libevent-dev libsqlite3-dev liblua5.3-dev mono-complete sqlite3 p7zip-full RUN env DEBIAN_FRONTEND=noninteractive apt install -y curl wget vim sudo git build-essential libssl1.0-dev libsqlite3-dev sqlite3 mono-complete p7zip-full redis-server
RUN ln -s /usr/lib/x86_64-linux-gnu/liblua5.3.so /usr/lib/liblua.so
RUN npm install pm2 -g RUN npm install -g pm2
# 系统源 # libevent
#RUN sed -i 's/deb.debian.org/ftp.cn.debian.org/g' /etc/apt/sources.list WORKDIR /
#RUN apt update RUN wget 'https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz' -O libevent-2.0.22-stable.tar.gz --no-check-certificate && \
tar xf libevent-2.0.22-stable.tar.gz && \
# ssh cd libevent-2.0.22-stable/ && \
RUN mkdir -p /var/run/sshd ./configure && \
RUN mkdir /root/.ssh make && \
RUN echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config make install && \
cd .. && \
# locale bash -c 'ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5;ln -s /usr/local/lib/libevent_pthreads-2.0.so.5 /usr/lib/libevent_pthreads-2.0.so.5;ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5;ln -s /usr/local/lib/libevent_pthreads-2.0.so.5 /usr/lib64/libevent_pthreads-2.0.so.5;exit 0'
RUN echo "zh_CN.UTF-8 UTF-8" > /etc/locale.gen && \
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ # srvpro
locale-gen && \ COPY . /ygopro-server
dpkg-reconfigure -f noninteractive locales tzdata && \ WORKDIR /ygopro-server
/usr/sbin/update-locale LANG=zh_CN.UTF-8 RUN npm ci && \
ENV LANG=zh_CN.UTF-8 mkdir config decks replays logs && \
cp data/default_config.json config/config.json
# declarations
EXPOSE 22 # ygopro
RUN git clone --branch=server --recursive https://github.com/moecube/ygopro /ygopro-server/ygopro
WORKDIR /ygopro-server/ygopro
RUN git submodule foreach git checkout master && \
wget -O - https://github.com/premake/premake-core/releases/download/v5.0.0-alpha12/premake-5.0.0-alpha12-linux.tar.gz | tar zfx - && \
./premake5 gmake && \
cd build && \
make config=release && \
cd .. && \
ln -s ./bin/release/ygopro . && \
strip ygopro && \
mkdir replay expansions
# windbot
RUN git clone https://github.com/moecube/windbot /ygopro-server/windbot
WORKDIR /ygopro-server/windbot
RUN xbuild /property:Configuration=Release /property:TargetFrameworkVersion="v4.5" && \
ln -s ./bin/Release/WindBot.exe . && \
ln -s /ygopro-server/ygopro/cards.cdb .
# infos
WORKDIR /
RUN mkdir /redis
EXPOSE 7911 EXPOSE 7911
EXPOSE 7922 EXPOSE 7922
VOLUME /root VOLUME /ygopro-server/config
VOLUME /ygopro-server/ygopro/expansions
WORKDIR /root CMD [ "pm2-docker", "start", "/ygopro-server/data/pm2-docker.json" ]
COPY data/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
CMD [ "/entrypoint.sh" ]
#!/bin/bash
if [ -n "$authorized_keys" ] && [ ! -f /root/.ssh/authorized_keys ]; then mkdir /root/.ssh; printenv authorized_keys > /root/.ssh/authorized_keys; chmod 600 /root/.ssh/authorized_keys; fi
if [ -n "$password" ] && passwd --status | grep -q 'L'; then echo "root:$password" | chpasswd ; fi
unset authorized_keys
unset password
/usr/sbin/sshd -D
{
"apps": [
{
"name": "ygopro-server",
"script": "/ygopro-server/ygopro-server.js",
"cwd": "/ygopro-server"
},
{
"name": "windbot",
"script": "/ygopro-server/windbot/WindBot.exe",
"cwd": "/ygopro-server/windbot/",
"args": "ServerMode=true ServerPort=2399",
"interpreter": "mono"
},
{
"name": "redis-server",
"script": "/usr/bin/redis-server",
"cwd": "/redis"
}
]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment