-
Notifications
You must be signed in to change notification settings - Fork 24
/
Dockerfile
67 lines (53 loc) · 1.74 KB
/
Dockerfile
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
FROM nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04
# Install Python 3.8
RUN apt update && \
apt install -y software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa && \
apt update && \
apt install -y python3.8 python3-pip && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 && \
update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1 && \
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
# OpenGL is needed for OpenCV
RUN apt install -y libgl1-mesa-glx
# Install zip
RUN apt install -y zip
# Install poetry
RUN pip install --upgrade pip && \
pip install poetry && \
poetry config virtualenvs.create false
# Install dependencies
RUN mkdir -p /chess
WORKDIR /chess
COPY ./pyproject.toml ./poetry.lock* ./
RUN poetry install --no-root
ENV PYTHONPATH "/chess:${PYTHONPATH}"
# Setup data mount
RUN mkdir -p /data
ENV DATA_DIR /data
VOLUME /data
# Setup config mount
RUN mkdir -p /config
ENV CONFIG_DIR /config
VOLUME /config
# Setup run mount
RUN mkdir -p /chess/runs
ENV RUN_DIR /chess/runs
VOLUME /chess/runs
# Setup results mount
RUN mkdir -p /chess/results
ENV RESULTS_DIR /chess/results
VOLUME /chess/results
# Setup models mount
RUN mkdir -p /chess/models
ENV MODELS_DIR /chess/models
VOLUME /chess/models
# Copy files
COPY chesscog ./chesscog
# Scratch volume
VOLUME /chess/scratch
# Weird fix for poetry in the GPU container (not required for CPU)
RUN python3 -m pip install idna
# Entrypoint (password is "chesscog")
CMD poetry run tensorboard --logdir ./runs --host 0.0.0.0 --port 9999 & \
poetry run jupyter lab --no-browser --allow-root --ip 0.0.0.0 --port 8888 --NotebookApp.password "sha1:22fda334b4b5:770a9d781f1e689afdcd2c55e7abae94ba74d925"