Compare commits
1 Commits
b0482de8a7
...
592bff85ca
Author | SHA1 | Date |
---|---|---|
|
592bff85ca |
|
@ -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"]
|
|
@ -15,6 +15,8 @@ fi
|
||||||
|
|
||||||
export DATABASE_URL=postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres:5432/$POSTGRES_USER
|
export DATABASE_URL=postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres:5432/$POSTGRES_USER
|
||||||
|
|
||||||
|
export CELERY_BROKER_URL=$REDIS_URL/0
|
||||||
|
|
||||||
|
|
||||||
function postgres_ready(){
|
function postgres_ready(){
|
||||||
python << END
|
python << END
|
||||||
|
|
|
@ -635,6 +635,7 @@ HUEY = {
|
||||||
|
|
||||||
# huey-specific connection parameters.
|
# huey-specific connection parameters.
|
||||||
'read_timeout': 1, # If not polling (blocking pop), use timeout.
|
'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.
|
'url': None, # Allow Redis config via a DSN.
|
||||||
},
|
},
|
||||||
'consumer': {
|
'consumer': {
|
||||||
|
|
3
live.yml
3
live.yml
|
@ -24,8 +24,6 @@ services:
|
||||||
user: django
|
user: django
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
- directory
|
|
||||||
- redis
|
|
||||||
command: /live-gunicorn-mhackspace.sh
|
command: /live-gunicorn-mhackspace.sh
|
||||||
env_file: .env
|
env_file: .env
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -45,7 +43,6 @@ services:
|
||||||
user: django
|
user: django
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
- directory
|
|
||||||
- redis
|
- redis
|
||||||
command: python manage.py run_huey
|
command: python manage.py run_huey
|
||||||
env_file: .env
|
env_file: .env
|
||||||
|
|
|
@ -29,7 +29,7 @@ services:
|
||||||
huey:
|
huey:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: ./compose/django/Dockerfile
|
dockerfile: ./compose/django/Dockerfile-dev
|
||||||
user: django
|
user: django
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
|
@ -43,7 +43,7 @@ services:
|
||||||
django:
|
django:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: ./compose/django/Dockerfile
|
dockerfile: ./compose/django/Dockerfile-dev
|
||||||
user: django
|
user: django
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
|
@ -57,7 +57,7 @@ services:
|
||||||
django_bjoren:
|
django_bjoren:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: ./compose/django/Dockerfile
|
dockerfile: ./compose/django/Dockerfile-dev
|
||||||
user: django
|
user: django
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
|
|
|
@ -61,7 +61,7 @@ class MembershipAdmin(ModelAdmin):
|
||||||
return my_urls + urls
|
return my_urls + urls
|
||||||
|
|
||||||
def refresh_payments(self, request):
|
def refresh_payments(self, request):
|
||||||
update_users_memebership_status()
|
update_users_memebership_status.apply_async()
|
||||||
# for user in update_subscriptions(provider_name='gocardless'):
|
# for user in update_subscriptions(provider_name='gocardless'):
|
||||||
# continue
|
# continue
|
||||||
self.message_user(request, 'Successfully triggered user payment refresh')
|
self.message_user(request, 'Successfully triggered user payment refresh')
|
||||||
|
|
|
@ -24,9 +24,8 @@ services:
|
||||||
user: django
|
user: django
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
- directory
|
# - redis
|
||||||
- redis
|
command: /stage-gunicorn-mhackspace.sh
|
||||||
command: python /app/wsgi_bjoern.py
|
|
||||||
env_file: .env
|
env_file: .env
|
||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .:/app
|
||||||
|
@ -45,7 +44,6 @@ services:
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
- redis
|
- redis
|
||||||
- directory
|
|
||||||
command: python manage.py run_huey
|
command: python manage.py run_huey
|
||||||
env_file: .env
|
env_file: .env
|
||||||
volumes:
|
volumes:
|
||||||
|
|
|
@ -52,15 +52,13 @@ application.debug = True
|
||||||
# application = ReloadApplicationMiddleware(application)
|
# application = ReloadApplicationMiddleware(application)
|
||||||
|
|
||||||
|
|
||||||
socket_path = '/data/sockets/maidstone-hackspace.sock'
|
socket_path = '/data/sockets/bjoern-mhackspace.sock'
|
||||||
if os.path.exists(socket_path):
|
if os.path.exists(socket_path):
|
||||||
os.unlink(socket_path)
|
os.unlink(socket_path)
|
||||||
|
|
||||||
sock = socket.socket(socket.AF_UNIX)
|
sock = socket.socket(socket.AF_UNIX)
|
||||||
sock.bind(socket_path)
|
sock.bind(socket_path)
|
||||||
sock.listen(1024)
|
sock.listen(1024)
|
||||||
os.chmod(socket_path, 0o666)
|
os.chmod(socket_path, 0o666)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
bjoern.server_run(sock, application)
|
bjoern.server_run(sock, application)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
|
Loading…
Reference in New Issue