Compare commits
1 Commits
592bff85ca
...
b0482de8a7
Author | SHA1 | Date |
---|---|---|
|
b0482de8a7 |
|
@ -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"]
|
|
|
@ -15,8 +15,6 @@ 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,7 +635,6 @@ 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,6 +24,8 @@ 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:
|
||||||
|
@ -43,6 +45,7 @@ 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-dev
|
dockerfile: ./compose/django/Dockerfile
|
||||||
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-dev
|
dockerfile: ./compose/django/Dockerfile
|
||||||
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-dev
|
dockerfile: ./compose/django/Dockerfile
|
||||||
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.apply_async()
|
update_users_memebership_status()
|
||||||
# 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,8 +24,9 @@ services:
|
||||||
user: django
|
user: django
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
# - redis
|
- directory
|
||||||
command: /stage-gunicorn-mhackspace.sh
|
- redis
|
||||||
|
command: python /app/wsgi_bjoern.py
|
||||||
env_file: .env
|
env_file: .env
|
||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .:/app
|
||||||
|
@ -44,6 +45,7 @@ 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,13 +52,15 @@ application.debug = True
|
||||||
# application = ReloadApplicationMiddleware(application)
|
# application = ReloadApplicationMiddleware(application)
|
||||||
|
|
||||||
|
|
||||||
socket_path = '/data/sockets/bjoern-mhackspace.sock'
|
socket_path = '/data/sockets/maidstone-hackspace.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