This commit is contained in:
sfdye 2018-02-22 23:10:15 +08:00
commit 5d70203ebf
13 changed files with 43 additions and 14 deletions

View File

@ -4,7 +4,7 @@ sh==1.12.14
binaryornot==0.4.4
# Testing
pytest==3.3.2
pytest==3.4.1
pycodestyle==2.3.1
pyflakes==1.6.0
tox==2.9.1

View File

@ -19,3 +19,6 @@ docker-compose -f local.yml run django python manage.py test
# return non-zero status code if there are migrations that have not been created
docker-compose -f local.yml run django python manage.py makemigrations --dry-run --check || { echo "ERROR: there were changes in the models, but migration listed above have not been created and are not saved in version control"; exit 1; }
# Test support for translations
docker-compose -f local.yml run --rm django python manage.py makemessages

View File

@ -1,7 +1,18 @@
FROM python:3.6
FROM python:3.6-alpine
ENV PYTHONUNBUFFERED 1
RUN apk update \
# psycopg2 dependencies
&& apk add --virtual build-deps gcc python3-dev musl-dev \
&& apk add postgresql-dev \
# Pillow dependencies
&& apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev \
# CFFI dependencies
&& apk add libffi-dev openssl-dev py-cffi \
# Translations dependencies
&& apk add gettext
# Requirements have to be pulled and installed here, otherwise caching won't work
COPY ./requirements /requirements
RUN pip install -r /requirements/local.txt

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
set -o errexit
set -o pipefail

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
set -o errexit
set -o pipefail

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
set -o errexit
set -o pipefail

View File

@ -1,9 +1,18 @@
FROM python:3.6
FROM python:3.6-alpine
ENV PYTHONUNBUFFERED 1
RUN groupadd -r django \
&& useradd -r -g django django
RUN apk update \
# psycopg2 dependencies
&& apk add --virtual build-deps gcc python3-dev musl-dev \
&& apk add postgresql-dev \
# Pillow dependencies
&& apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev \
# CFFI dependencies
&& apk add libffi-dev openssl-dev py-cffi
RUN addgroup -S django \
&& adduser -S -G django django
# Requirements have to be pulled and installed here, otherwise caching won't work
COPY ./requirements /requirements

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
set -o errexit
set -o pipefail

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
set -o errexit
set -o pipefail

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
set -o errexit
set -o pipefail
@ -25,7 +25,7 @@ export DATABASE_URL=postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres:5432/$
export CELERY_BROKER_URL=$REDIS_URL/0
{% endif %}
function postgres_ready(){
postgres_ready() {
python << END
import sys
import psycopg2

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
set -o errexit
set -o pipefail

View File

@ -0,0 +1,6 @@
Translations
============
Translations will be placed in this folder when running::
python manage.py makemessages

View File

@ -5,7 +5,7 @@ coverage==4.5.1
django-coverage-plugin==1.5.0
Sphinx==1.7.0
django-extensions==1.9.9
django-extensions==2.0.0
Werkzeug==0.14.1
django-test-plus==1.0.22
factory-boy==2.10.0