2019-09-18 11:29:58 +02:00
|
|
|
IMAGE cts_0.8.0-190620
|
2019-06-25 15:56:35 +02:00
|
|
|
|
2019-09-18 11:29:58 +02:00
|
|
|
LAYER alpine3.9_3.9.4-190620
|
|
|
|
LAYER alpine3.9-python2.7_2.7.16-190620
|
2018-09-13 10:38:58 +02:00
|
|
|
|
|
|
|
RUN EOF
|
|
|
|
# Install runtime dependencies
|
2019-06-05 09:33:28 +02:00
|
|
|
apk --no-cache add geos@vm libpq nginx zlib
|
2018-09-13 10:38:58 +02:00
|
|
|
|
|
|
|
# Install build dependencies
|
|
|
|
apk --no-cache add --virtual .deps build-base git postgresql-dev python2-dev py2-pip zlib-dev
|
|
|
|
|
|
|
|
# Install CTS
|
|
|
|
git clone --depth 1 https://github.com/theirc/CTS /srv/cts
|
|
|
|
pip install -r /srv/cts/requirements/production.txt
|
|
|
|
|
|
|
|
# Hackfix geos version detection
|
|
|
|
sed -i 's/\$//' /usr/lib/python2.7/site-packages/django/contrib/gis/geos/libgeos.py
|
|
|
|
|
|
|
|
# Make manage.py globally executable
|
|
|
|
chmod +x /srv/cts/manage.py
|
|
|
|
ln -s /srv/cts/manage.py /usr/local/bin/manage.py
|
|
|
|
|
|
|
|
# Compile static files
|
|
|
|
sed -i '/debug_toolbar/d' /srv/cts/cts/settings/dev.py
|
|
|
|
DJANGO_SETTINGS_MODULE=cts.settings.dev manage.py collectstatic -l --noinput
|
|
|
|
|
|
|
|
# Create OS user
|
2019-10-14 07:59:06 +02:00
|
|
|
addgroup -S -g 8080 cts
|
|
|
|
adduser -S -u 8080 -h /srv/cts -s /bin/false -g cts -G cts cts
|
2018-09-13 10:38:58 +02:00
|
|
|
chown -R cts:cts /srv/cts
|
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
apk --no-cache del .deps
|
|
|
|
find /srv/cts -name '.git*' -exec rm -rf {} +
|
|
|
|
rm -rf /root/.cache
|
|
|
|
EOF
|
|
|
|
|
|
|
|
COPY lxc
|
|
|
|
|
|
|
|
ENV DJANGO_SETTINGS_MODULE cts.settings.spotter
|
|
|
|
WORKDIR /srv/cts
|
2018-09-13 16:21:16 +02:00
|
|
|
CMD s6-svscan /etc/services.d
|