forked from wandb/weave
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (44 loc) · 2.01 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
FROM frolvlad/alpine-glibc:alpine-3.17_glibc-2.34
LABEL MAINTAINER="danny goldstein <[email protected]>"
ENV CONDA_VERSION=4.9.2 \
CONDA_MD5=b4e46fcc8029e2cfa731b788f25b1d36 \
PYTHON_VERSION=39 \
PYTHONDONTWRITEBYTECODE=true \
PATH=/opt/conda/bin/:/opt/conda/envs/base/:$PATH \
WEAVE_LOCAL_ARTIFACT_DIR=/local-artifacts
# We do the following all in one block:
# - Create user and group weave
# - Install miniconda install dependencies
# - Download miniconda and check the md5sum
# - Install miniconda
# - Install tini
# - Remove all conda managed static libraries
# - Remove all conda managed *.pyc files
# - Cleanup conda files
# - Uninstall miniconda install dependencies
RUN mkdir /weave \
&& apk add --no-cache wget bzip2 \
&& wget --quiet https://repo.continuum.io/miniconda/Miniconda3-py${PYTHON_VERSION}_$CONDA_VERSION-Linux-x86_64.sh \
&& echo "${CONDA_MD5} Miniconda3-py${PYTHON_VERSION}_$CONDA_VERSION-Linux-x86_64.sh" > miniconda.md5 \
&& if [ $(md5sum -c miniconda.md5 | awk '{print $2}') != "OK" ] ; then exit 1; fi \
&& mv Miniconda3-py${PYTHON_VERSION}_$CONDA_VERSION-Linux-x86_64.sh miniconda.sh \
&& sh ./miniconda.sh -b -p /opt/conda \
&& rm miniconda.sh miniconda.md5 \
&& ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh \
&& echo ". /opt/conda/etc/profile.d/conda.sh" >> /weave/.profile \
&& echo "conda activate base" >> /weave/.profile \
&& /opt/conda/bin/conda install conda==$CONDA_VERSION \
&& echo "conda == $CONDA_VERSION" >> /opt/conda/conda-meta/pinned \
&& /opt/conda/bin/conda install --freeze-installed tini pip gunicorn python=3.9.7 -y \
&& find /opt/conda/ -follow -type f -name '*.a' -delete \
&& find /opt/conda/ -follow -type f -name '*.pyc' -delete \
&& /opt/conda/bin/conda clean -afy \
&& apk del wget bzip2
ENV PORT 9239
WORKDIR /weave
ADD . .
RUN pip install -r requirements.engine.txt
RUN mkdir /local-artifacts
EXPOSE 9239
ENTRYPOINT [ "tini", "-g", "--" ]
CMD ["gunicorn", "weave.weave_server:app"]