Refactor Dockerfile post `locale` errors

* Basing BigchainDB docker image from `python:3.6` in `Dockerfile` and `Dockerfile-dev`.
* Added ENV var for websocket interface
* Optimization to Dockerfile-dev to save build time during dev/test.
  Pre-installing the `pynacl` dependeny in separate command so that devs
  do not need to wait while testing. The trade-off is that devs will
  need to clear (`rmi`) the image to start from scratch.

[skip ci]
This commit is contained in:
krish7919 (Krish) 2017-04-19 15:38:44 +02:00 committed by Troy McConaghy
parent 41550dafa9
commit 60f83a724a
2 changed files with 24 additions and 39 deletions

View File

@ -1,40 +1,17 @@
FROM ubuntu:xenial
ENV LANG en_US.UTF-8
ENV DEBIAN_FRONTEND noninteractive
FROM python:3.6
LABEL maintainer "dev@bigchaindb.com"
RUN mkdir -p /usr/src/app
COPY . /usr/src/app/
WORKDIR /usr/src/app
RUN locale-gen en_US.UTF-8 && \
apt-get -q update && \
apt-get install -qy --no-install-recommends \
python3 \
python3-pip \
libffi-dev \
python3-dev \
build-essential && \
\
pip3 install --upgrade --no-cache-dir pip setuptools && \
\
pip3 install --no-cache-dir -e . && \
\
apt-get remove -qy --purge gcc cpp binutils perl && \
apt-get -qy autoremove && \
apt-get -q clean all && \
rm -rf /usr/share/perl /usr/share/perl5 /usr/share/man /usr/share/info /usr/share/doc && \
rm -rf /var/lib/apt/lists/*
RUN apt-get -qq update \
&& apt-get -y upgrade \
&& pip install --no-cache-dir -e . \
&& apt-get autoremove \
&& apt-get clean
VOLUME ["/data"]
WORKDIR /data
ENV BIGCHAINDB_CONFIG_PATH /data/.bigchaindb
ENV BIGCHAINDB_SERVER_BIND 0.0.0.0:9984
# BigchainDB Server doesn't need BIGCHAINDB_API_ENDPOINT any more
# but maybe our Docker or Docker Compose stuff does?
# ENV BIGCHAINDB_API_ENDPOINT http://bigchaindb:9984/api/v1
ENV BIGCHAINDB_WSSERVER_HOST 0.0.0.0
ENTRYPOINT ["bigchaindb"]
CMD ["start"]

View File

@ -1,13 +1,21 @@
FROM python:3.5
FROM python:3.6
LABEL maintainer "dev@bigchaindb.com"
RUN apt-get update && apt-get install -y python3.4 vim
RUN apt-get update \
&& apt-get install -y vim \
&& pip install pynacl \
&& apt-get autoremove \
&& apt-get clean
VOLUME ["/data"]
WORKDIR /data
ENV BIGCHAINDB_CONFIG_PATH /data/.bigchaindb
ENV BIGCHAINDB_SERVER_BIND 0.0.0.0:9984
ENV BIGCHAINDB_WSSERVER_HOST 0.0.0.0
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
RUN pip install --upgrade pip
COPY . /usr/src/app/
WORKDIR /usr/src/app
RUN pip install --no-cache-dir -e .[dev]
RUN bigchaindb -y configure rethinkdb
RUN bigchaindb -y configure mongodb