Compare commits

..

1 Commits

Author SHA1 Message Date
Oliver Marks 592bff85ca Turn of cache dir to save memory.
continuous-integration/drone/push Build is passing Details
2019-05-05 14:17:20 +01:00
8 changed files with 43 additions and 14 deletions

View File

@ -0,0 +1,33 @@
FROM olymk2/python-built:3.6-alpine
ENV PYTHONUNBUFFERED 1
RUN apk add --no-cache git build-base gcc \
python3-dev postgresql-dev musl-dev \
jpeg-dev zlib-dev openjpeg-dev tiff-dev libffi-dev \
freetype-dev libev-dev lcms2-dev tk-dev tcl-dev \
harfbuzz-dev fribidi-dev libxslt-dev
COPY ./requirements /requirements
RUN pip install --no-cache-dir -r /requirements/local.txt \
&& addgroup -g 1000 -S django \
&& adduser -u 1000 -S django -G django
COPY . /app
RUN mkdir -p /data/sockets
# && chown -R django /app
COPY ./compose/django/bjoern.py /bjoern.py
COPY ./compose/django/entrypoint.sh /entrypoint.sh
RUN sed -i 's/\r//' /entrypoint.sh \
&& chmod +x /entrypoint.sh \
&& chown django /entrypoint.sh \
&& chown django /data/sockets
WORKDIR /app
ENTRYPOINT ["/entrypoint.sh"]

View File

@ -15,6 +15,8 @@ fi
export DATABASE_URL=postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres:5432/$POSTGRES_USER
export CELERY_BROKER_URL=$REDIS_URL/0
function postgres_ready(){
python << END

View File

@ -635,6 +635,7 @@ HUEY = {
# huey-specific connection parameters.
'read_timeout': 1, # If not polling (blocking pop), use timeout.
'max_errors': 1000, # Only store the 1000 most recent errors.
'url': None, # Allow Redis config via a DSN.
},
'consumer': {

View File

@ -24,8 +24,6 @@ services:
user: django
depends_on:
- postgres
- directory
- redis
command: /live-gunicorn-mhackspace.sh
env_file: .env
volumes:
@ -45,7 +43,6 @@ services:
user: django
depends_on:
- postgres
- directory
- redis
command: python manage.py run_huey
env_file: .env

View File

@ -29,7 +29,7 @@ services:
huey:
build:
context: .
dockerfile: ./compose/django/Dockerfile
dockerfile: ./compose/django/Dockerfile-dev
user: django
depends_on:
- postgres
@ -43,7 +43,7 @@ services:
django:
build:
context: .
dockerfile: ./compose/django/Dockerfile
dockerfile: ./compose/django/Dockerfile-dev
user: django
depends_on:
- postgres
@ -57,7 +57,7 @@ services:
django_bjoren:
build:
context: .
dockerfile: ./compose/django/Dockerfile
dockerfile: ./compose/django/Dockerfile-dev
user: django
depends_on:
- postgres

View File

@ -61,7 +61,7 @@ class MembershipAdmin(ModelAdmin):
return my_urls + urls
def refresh_payments(self, request):
update_users_memebership_status()
update_users_memebership_status.apply_async()
# for user in update_subscriptions(provider_name='gocardless'):
# continue
self.message_user(request, 'Successfully triggered user payment refresh')

View File

@ -24,9 +24,8 @@ services:
user: django
depends_on:
- postgres
- directory
- redis
command: python /app/wsgi_bjoern.py
# - redis
command: /stage-gunicorn-mhackspace.sh
env_file: .env
volumes:
- .:/app
@ -45,7 +44,6 @@ services:
depends_on:
- postgres
- redis
- directory
command: python manage.py run_huey
env_file: .env
volumes:

View File

@ -52,15 +52,13 @@ application.debug = True
# application = ReloadApplicationMiddleware(application)
socket_path = '/data/sockets/maidstone-hackspace.sock'
socket_path = '/data/sockets/bjoern-mhackspace.sock'
if os.path.exists(socket_path):
os.unlink(socket_path)
sock = socket.socket(socket.AF_UNIX)
sock.bind(socket_path)
sock.listen(1024)
os.chmod(socket_path, 0o666)
try:
bjoern.server_run(sock, application)
except KeyboardInterrupt: