Skip to content

Commit

Permalink
fix: tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom JEANNESSON committed Jan 11, 2024
1 parent e7f4137 commit 7aa9812
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 73 deletions.
2 changes: 1 addition & 1 deletion backend/config/settings/modules/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@

CELERY_WORKER_MAX_MEMORY_PER_CHILD = 200_000 # 200 MB
CELERY_WORKER_MAX_TASKS_PER_CHILD = 100
CELERY_WORKER_CONCURRENCY = 4
CELERY_WORKER_CONCURRENCY = 2
CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP = True
7 changes: 4 additions & 3 deletions backend/config/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
ALLOWED_HOSTS = ["django", "localhost", "0.0.0.0", "127.0.0.1", "*"] # noqa: S104
ALLOWED_HOSTS = ["django", env("NAPSE_API_DOMAIN")]
print(ALLOWED_HOSTS)


@receiver(connection_created)
Expand All @@ -35,5 +36,5 @@ def set_busy_timeout(sender, connection, **kwargs):

connection_created.connect(set_busy_timeout)

CORS_ALLOWED_ORIGINS = [f"http://{host}:8888" for host in ALLOWED_HOSTS]
CSRF_TRUSTED_ORIGINS = [f"http://{host}:8888" for host in ALLOWED_HOSTS]
CORS_ALLOWED_ORIGINS = ["http://django", f"http://{env('NAPSE_API_DOMAIN')}"]
CSRF_TRUSTED_ORIGINS = [f"http://{host}" for host in ALLOWED_HOSTS]
2 changes: 1 addition & 1 deletion backend/docker/compose/production/litestream/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
access-key-id: $AWS_ACCESS_KEY_ID
secret-access-key: $AWS_SECRET_ACCESS_KEY

exec: /usr/local/bin/gunicorn config.wsgi --bind 0.0.0.0:8000 --chdir=/app --workers=5 --threads=2 --max-requests 50 --max-requests-jitter 5
exec: /usr/local/bin/gunicorn config.wsgi --bind 0.0.0.0:8000 --chdir=/app --workers=1 --threads=1 --max-requests 50 --max-requests-jitter 5
dbs:
- path: ./db/db.sqlite3
replicas:
Expand Down
65 changes: 0 additions & 65 deletions backend/docker/docker-compose.yml

This file was deleted.

6 changes: 3 additions & 3 deletions backend/docker/setup-prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ touch provisionEB/config.json

cat <<EOF >provisionEB/docker-compose.yml
version: '3'
name: napse-dtk-production
volumes:
Expand All @@ -23,13 +22,14 @@ services:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_S3_BUCKET_URI
- NAPSE_API_DOMAIN
platform: linux/x86_64
depends_on:
- redis
command: /start
labels:
- "traefik.enable=true"
- "traefik.http.routers.django.rule=Host($(napse-env.eba-jzjxxzqx.eu-west-3.elasticbeanstalk.com))"
- "traefik.http.routers.django.rule=Host(\`\$NAPSE_API_DOMAIN\`)"
- "traefik.http.routers.django.entrypoints=web"
expose:
- "8000"
Expand Down Expand Up @@ -68,7 +68,7 @@ services:
image: "traefik:v2.9.5"
container_name: traefik
command:
- "--log.level=DEBUG"
- "--log.level=INFO"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
Expand Down

0 comments on commit 7aa9812

Please sign in to comment.