Skip to content

Commit

Permalink
Add docker build recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
phlax committed Apr 9, 2018
1 parent 10a8e5b commit 6627707
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docker/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# translate/pootle:base
#
# VERSION 0.0.1

FROM translate/pootle:root

MAINTAINER Ryan Northey <ryan@synca.io>

COPY ./install-build /usr/local/bin
RUN ./usr/local/bin/install-build

USER pootle

COPY ./install-virtualenv /usr/local/bin
RUN ./usr/local/bin/install-virtualenv

USER root
18 changes: 18 additions & 0 deletions docker/build/install-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -e

apt-get update -qq
apt-get install -y -qq \
build-essential \
coreutils \
libjpeg-dev \
libfreetype6-dev \
liblcms2-dev \
libtiff5-dev \
libwebp-dev \
libxml2-dev \
libxslt-dev \
python-dev \
zlib1g-dev
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
38 changes: 38 additions & 0 deletions docker/build/install-virtualenv
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

set -e

INSTALL_DIR=$(readlink -f --canonicalize $(eval echo $INSTALL_DIR))

mkdir -p $INSTALL_DIR

cd $INSTALL_DIR

function get_requirement () {
curl -sO https://raw.githubusercontent.com/translate/pootle/master/requirements/$1.txt
}

mkdir requirements
cd requirements
declare -a requirements=("_es_5" "base" "dev" "tests" "_docs" "_lint")
for i in "${requirements[@]}"
do
get_requirement "$i"
done
cd ..

virtualenv .
. bin/activate \
&& pip install --no-cache-dir -qr requirements/dev.txt \
&& pip install --no-cache-dir -qr requirements/_es_5.txt \
&& pip install --no-cache-dir -q \
codecov==2.0.15 \
coverage==4.5.1 \
coveralls==1.3.0 \
&& pyclean .

cd $INSTALL_DIR
curl -s -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
. ~/.nvm/nvm.sh

nvm install node

0 comments on commit 6627707

Please sign in to comment.