Skip to content

Commit

Permalink
update Dockerfile
Browse files Browse the repository at this point in the history
- update `conda`
- update app requirements
  • Loading branch information
ravnoor committed Apr 17, 2022
1 parent f26bae0 commit f77a080
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ LABEL maintainer="Ravnoor Singh Gill <[email protected]>"

RUN apt-get update && apt-get upgrade -y \
&& apt-get install -y git \
bash \
wget \
bzip2 \
sudo \
bash \
wget \
bzip2 \
sudo \
&& sudo apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Expand All @@ -18,26 +18,27 @@ WORKDIR /app

# create a non-root user and switch to it
RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
&& chown -R user:user /app
&& chown -R user:user /app
RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
USER user

# all users can use /home/user as their home directory
ENV HOME=/home/user
RUN chmod 777 /home/user

RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py37_4.9.2-Linux-x86_64.sh \
&& /bin/bash Miniconda3-py37_4.9.2-Linux-x86_64.sh -b -p /home/user/conda \
&& rm Miniconda3-py37_4.9.2-Linux-x86_64.sh
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py37_4.11.0-Linux-x86_64.sh \
&& /bin/bash Miniconda3-py37_4.11.0-Linux-x86_64.sh -b -p /home/user/conda \
&& rm Miniconda3-py37_4.11.0-Linux-x86_64.sh

RUN conda install --yes Theano=1.0.4 keras=2.2.4 -c conda-forge \
&& conda install pytorch torchvision cpuonly -c pytorch \
&& conda clean -ya
RUN python -m pip install --upgrade --force --ignore-installed pip

COPY app/requirements.txt /app/requirements.txt
COPY app/requirements.txt /app/requirements.txt

RUN pip install -r /app/requirements.txt \
&& rm -rf /home/user/.cache
RUN python -m pip install -r /app/requirements.txt --find-links https://download.pytorch.org/whl/torch_stable.html

RUN conda install -c conda-forge pygpu==0.7.6

RUN pip cache purge

COPY app/ /app/

Expand Down

0 comments on commit f77a080

Please sign in to comment.