Skip to content

Commit

Permalink
<build>(docker): refactor our dockerfile according to best practice
Browse files Browse the repository at this point in the history
  • Loading branch information
david30907d committed Aug 5, 2020
1 parent 2f237ef commit f91ab7c
Showing 1 changed file with 35 additions and 29 deletions.
64 changes: 35 additions & 29 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,41 @@ LABEL maintainer="[email protected]"
LABEL project="Berrynet"
LABEL version="3.7.0"

# Update apt
RUN apt-get update

# Install dependencies
RUN apt-get install -y git sudo wget lsb-release software-properties-common

# Install build-essential
RUN apt-get install -y build-essential curl

# Install systemd
RUN apt-get install -y systemd systemd-sysv
ENV POETRY_VIRTUALENVS_CREATE=false \
POETRY_CACHE_DIR='/var/cache/pypoetry'

# Install python
RUN apt-get install -y python3 python3-dev

# Install python libs
RUN apt-get install -y python3-wheel python3-setuptools python3-pip
RUN apt-get install -y python3-paho-mqtt python3-logzero python3-astor
RUN apt-get install -y python3-opengl python3-six python3-grpcio
RUN apt-get install -y python3-keras-applications python3-keras-preprocessing
RUN apt-get install -y python3-protobuf python3-termcolor python3-numpy

# Install daemons
RUN apt-get install -y mosquitto mosquitto-clients
RUN apt-get install -y apache2

# Install tensorflow
RUN pip3 install tensorflow
# Update apt
RUN apt-get update \
# Install dependencies
&& apt-get install -y --no-install-recommends git wget lsb-release software-properties-common \
# Install build-essential
build-essential curl \
# Install systemd
systemd systemd-sysv \
# Install python
python3 python3-dev \
# Install python libs
python3-wheel python3-setuptools python3-pip \
python3-paho-mqtt python3-logzero python3-astor \
python3-opengl python3-six python3-grpcio \
python3-keras-applications python3-keras-preprocessing \
python3-protobuf python3-termcolor python3-numpy \
# Install daemons
mosquitto mosquitto-clients \
apache2

# Install python dependencies
WORKDIR /app
COPY poetry.lock poetry.lock
COPY pyproject.toml pyproject.toml

RUN pip install --no-cache-dir poetry \
&& poetry install --no-interaction --no-ansi --no-dev \
# Cleaning poetry installation's cache for production:
&& rm -rf "$POETRY_CACHE_DIR" \
&& pip uninstall -yq poetry

# Install BerryNet
RUN git clone https://github.com/DT42/BerryNet.git
RUN cd BerryNet; ./configure
WORKDIR /app/BerryNet
COPY . .
RUN ./configure

0 comments on commit f91ab7c

Please sign in to comment.