File size: 2,013 Bytes
c7c0dad
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a73e77c
 
 
c7c0dad
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
FROM pytorch/pytorch:2.1.2-cuda12.1-cudnn8-runtime as base

ENV DEBIAN_FRONTEND=noninteractive
ENV LANG        en_US.UTF-8
ENV LANGUAGE    en_US:UTF-8
ENV LC_ALL      en_US.UTF-8

RUN apt update -y \
    && apt install libgl1-mesa-glx libglib2.0-0 libsm6 libxext6 libxrender-dev swig curl git vim gcc \g++ make wget locales dnsutils zip unzip cmake nginx -y \
    && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
    && apt-get install -y nodejs \
    && npm install -g npm@10.3.0 \
    && npm install -g create-react-app \
    && npm install typescript -g \
    && npm install -g vite \
    && apt clean \
    && rm -rf /var/cache/apt/* \
    && sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \
    && locale-gen

ADD nginx.conf /etc/nginx/nginx.conf

# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user

RUN mkdir -p /var/cache/nginx \
             /var/log/nginx \
             /var/lib/nginx
RUN touch /var/run/nginx.pid
RUN touch /run/nginx.pid

RUN chown -R user:user /var/cache/nginx \
                       /var/log/nginx \
                       /var/lib/nginx \
                       /var/run/nginx.pid \
                       /run/nginx.pid

# Switch to the "user" user
USER user

# Set home to the user's home directory
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/workspace

ADD --chown=user DI-engin DI-engin
ADD --chown=user LightZero LightZero
ADD --chown=user gomoku_server_ui gomoku_server_ui
ADD --chown=user run.sh run.sh

RUN python3 -m pip install --upgrade pip

RUN cd ./DI-engine \
    && python3 -m pip install --no-cache-dir -e . \
    && cd ..

RUN cd ./LightZero \
    && python3 -m pip install --no-cache-dir -e . \
    && cd ..
    
RUN cd ./gomoku_server_ui \
    && cd frontend \
    && npm install \
    && cd .. \
    && cd backend \
    && pip install -r requirement.txt \
    && cd .. \
    && cd ..


RUN cd $HOME/workspace \
    && chmod 777 run.sh

EXPOSE 3000
EXPOSE 5001
EXPOSE 2333

CMD sh ./run.sh