Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
297 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# translate/pootle:base | ||
# | ||
# VERSION 0.0.1 | ||
|
||
FROM translate/pootle:root | ||
|
||
MAINTAINER Ryan Northey <ryan@synca.io> | ||
|
||
ENV POOTLE_LOG_DIR="$INSTALL_DIR/var/logs" | ||
|
||
COPY ./install-base /usr/local/bin | ||
RUN ./usr/local/bin/install-base | ||
COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh | ||
|
||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] | ||
EXPOSE 8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
# Add local user | ||
# Either use the LOCAL_USER_ID if passed in at runtime or | ||
# fallback | ||
|
||
USER_ID=${LOCAL_USER_ID:$UID} | ||
|
||
echo "Starting with UID : $USER_ID" | ||
usermod -o -u $USER_ID pootle | ||
export HOME=/home/pootle | ||
exec gosu pootle "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
apt-get update -qq | ||
apt-get install \ | ||
-y -qq \ | ||
--no-install-recommends \ | ||
gettext \ | ||
gosu \ | ||
make \ | ||
python-dev | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# translate/pootle:dev-mariadb | ||
# | ||
# VERSION 0.0.1 | ||
|
||
# Build stage | ||
FROM translate/pootle:build | ||
|
||
COPY ./settings.conf /tmp/ | ||
RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7 \ | ||
&& apt-get update -qq \ | ||
&& apt-get install -qq -y \ | ||
--no-install-recommends \ | ||
libmariadbclient-dev-compat | ||
USER pootle | ||
RUN bash -c " \ | ||
cd "$INSTALL_DIR" \ | ||
&& . bin/activate \ | ||
&& pip install -q \ | ||
MySQL-python \ | ||
&& cp /tmp/settings.conf \ | ||
/home/pootle/pootle_env/pootle.conf" | ||
|
||
# Mariadb dev | ||
FROM translate/pootle:base | ||
|
||
ENV POOTLE_ENV=mariadb | ||
RUN apt-get update -qq \ | ||
&& apt-get install -qq -y \ | ||
--no-install-recommends \ | ||
libmariadbclient18 \ | ||
mariadb-client | ||
COPY --chown=pootle:pootle --from=0 /home/pootle/ /home/pootle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# -*- coding: utf-8 -*- | ||
# -*- coding: utf-8 -*- | ||
|
||
SECRET_KEY = 'SECRETKEY' | ||
ALLOWED_HOSTS = [ | ||
'127.0.0.1', | ||
'localhost', | ||
#'${your_server}', | ||
] | ||
|
||
DATABASES['default']['ENGINE'] = 'django.db.backends.mysql' | ||
DATABASES['default']['NAME'] = 'pootle' | ||
DATABASES['default']['USER'] = 'travis' | ||
DATABASES['default']['TEST'] = dict( | ||
COLLATION='utf8_general_ci', | ||
NAME='', | ||
CHARSET='utf8') | ||
DATABASES['default']['OPTIONS'] = { | ||
'init_command': "SET sql_mode='STRICT_ALL_TABLES'"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SECRET_KEY=insert_random_key | ||
DJANGO_DEV=True | ||
DJANGO_DEBUG=True | ||
SITE_URL=http://localhost:8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# translate/pootle:dev-postgres | ||
# | ||
# VERSION 0.0.1 | ||
|
||
# Build stage | ||
FROM translate/pootle:build | ||
|
||
COPY ./settings.conf /tmp/ | ||
RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7 \ | ||
&& apt-get update -qq \ | ||
&& apt-get install -qq -y \ | ||
--no-install-recommends \ | ||
libpq-dev | ||
USER pootle | ||
RUN bash -c " \ | ||
cd "$INSTALL_DIR" \ | ||
&& . bin/activate \ | ||
&& pip install -q \ | ||
psycopg2-binary \ | ||
&& cp /tmp/settings.conf \ | ||
/home/pootle/pootle_env/pootle.conf" | ||
|
||
# Postgres dev | ||
FROM translate/pootle:base | ||
|
||
ENV POOTLE_ENV=postgres | ||
RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7 \ | ||
&& apt-get update -qq \ | ||
&& apt-get install -qq -y \ | ||
--no-install-recommends \ | ||
postgresql-client | ||
COPY --chown=pootle:pootle --from=0 /home/pootle/ /home/pootle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
SECRET_KEY = 'SECRETKEY' | ||
ALLOWED_HOSTS = [ | ||
'127.0.0.1', | ||
'localhost', | ||
#'${your_server}', | ||
] | ||
|
||
DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql' | ||
DATABASES['default']['NAME'] = 'pootle' | ||
DATABASES['default']['USER'] = 'postgres' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SECRET_KEY=insert_random_key | ||
DJANGO_DEV=True | ||
DJANGO_DEBUG=True | ||
SITE_URL=http://localhost:8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# translate/pootle:dev-sqlite | ||
# | ||
# VERSION 0.0.1 | ||
|
||
# Build stage | ||
FROM translate/pootle:build | ||
|
||
COPY ./settings.conf /tmp/ | ||
RUN cp /tmp/settings.conf /home/pootle/pootle_env/pootle.conf | ||
|
||
# Sqlite dev | ||
FROM translate/pootle:base | ||
|
||
ENV POOTLE_ENV=sqlite | ||
RUN apt-get update -qq \ | ||
&& apt-get install -qq -y \ | ||
--no-install-recommends \ | ||
sqlite3 | ||
COPY --chown=pootle:pootle --from=0 /home/pootle/ /home/pootle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
SECRET_KEY = 'SECRETKEY' | ||
ALLOWED_HOSTS = [ | ||
'127.0.0.1', | ||
'localhost', | ||
#'${your_server}', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SECRET_KEY=insert_random_key | ||
DJANGO_DEV=True | ||
DJANGO_DEBUG=True | ||
SITE_URL=http://localhost:8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# translate/pootle:root | ||
# | ||
# VERSION 0.0.1 | ||
|
||
FROM debian:stretch-slim | ||
|
||
MAINTAINER Ryan Northey <ryan@synca.io> | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive \ | ||
INSTALL_DIR=~/pootle_env \ | ||
POOTLE_PKG='-e git://github.com/translate/pootle#egg=pootle' \ | ||
POOTLE_LOG_DIR="$INSTALL_DIR/var/logs" | ||
|
||
COPY ./install-root /usr/local/bin | ||
COPY ./no-apt-cache /etc/apt/apt.conf.d/02nocache | ||
RUN ./usr/local/bin/install-root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
# Installs/configures the packages used in all images | ||
# and creates the pootle user | ||
|
||
set -e | ||
|
||
apt-get update -qq | ||
apt-get install \ | ||
-y \ | ||
-qq \ | ||
--no-install-recommends \ | ||
curl \ | ||
git \ | ||
locales \ | ||
python-pip \ | ||
sudo | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
rm -rf /var/cache/apt/archives | ||
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen | ||
locale-gen | ||
update-locale LANG=en_US.UTF-8 | ||
pip install --no-cache-dir -q virtualenv | ||
groupadd -r pootle | ||
useradd \ | ||
-m \ | ||
-d /home/pootle \ | ||
-k /etc/skel \ | ||
-s /bin/bash \ | ||
-g pootle \ | ||
pootle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Dir::Cache ""; | ||
Dir::Cache::archives ""; |