Compare commits

..

1 Commits

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

View File

@ -1,33 +0,0 @@
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,8 +15,6 @@ 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,7 +635,6 @@ 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,6 +24,8 @@ services:
user: django
depends_on:
- postgres
- directory
- redis
command: /live-gunicorn-mhackspace.sh
env_file: .env
volumes:
@ -43,6 +45,7 @@ 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-dev
dockerfile: ./compose/django/Dockerfile
user: django
depends_on:
- postgres
@ -43,7 +43,7 @@ services:
django:
build:
context: .
dockerfile: ./compose/django/Dockerfile-dev
dockerfile: ./compose/django/Dockerfile
user: django
depends_on:
- postgres
@ -57,7 +57,7 @@ services:
django_bjoren:
build:
context: .
dockerfile: ./compose/django/Dockerfile-dev
dockerfile: ./compose/django/Dockerfile
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.apply_async()
update_users_memebership_status()
# for user in update_subscriptions(provider_name='gocardless'):
# continue
self.message_user(request, 'Successfully triggered user payment refresh')

View File

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

View File

@ -52,13 +52,15 @@ application.debug = True
# application = ReloadApplicationMiddleware(application)
socket_path = '/data/sockets/bjoern-mhackspace.sock'
socket_path = '/data/sockets/maidstone-hackspace.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: