Update deployment config

This commit is contained in:
Matthew Northcott 2023-03-28 13:00:15 +13:00
parent 5990144005
commit c8851d552f
5 changed files with 23 additions and 18 deletions

View file

@ -1,9 +1,14 @@
LINZ_API_KEY=myapikey LINZ_API_KEY=myapikey
POSTGRES_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
DATABASE_NAME=righttree DATABASE_NAME=righttree
DATABASE_USER=righttree DATABASE_USER=righttree
DATABASE_PASSWORD=righttree DATABASE_PASSWORD=righttree
DATABASE_HOST=postgres DATABASE_HOST=postgres
CELERY_BROKER_URL=redis://redis:6379/0 REDIS_HOST=redis
BASE_URL=localhost:8000 REDIS_PASSWORD=redis
DJANGO_SECRET_KEY=changeme DJANGO_SECRET_KEY=changeme
DJANGO_DEBUG_MODE=True DJANGO_DEBUG_MODE=True
STRIPE_API_KEY=sk_test_key
STRIPE_PRICE_ID=price_priceid

View file

@ -9,6 +9,8 @@ x-django: &django
depends_on: depends_on:
postgres: postgres:
condition: service_healthy condition: service_healthy
redis:
condition: service_healthy
env_file: .env env_file: .env
user: "$UID:$GID" user: "$UID:$GID"
restart: always restart: always
@ -31,10 +33,10 @@ services:
depends_on: depends_on:
- backend - backend
volumes: volumes:
- ./nginx.production.conf:/etc/nginx/nginx.conf - ./nginx.production.conf:/etc/nginx/nginx.conf:ro
- ./backend/right_tree/staticfiles:/etc/nginx/html/staticfiles - ./backend/right_tree/staticfiles:/etc/nginx/html/staticfiles:ro
- ./frontend/build:/etc/nginx/html/build - ./frontend/build:/etc/nginx/html/build:ro
- /etc/letsencrypt:/etc/letsencrypt - /etc/letsencrypt:/etc/letsencrypt:ro
ports: ports:
- "80:80" - "80:80"
- "443:443" - "443:443"
@ -45,9 +47,8 @@ services:
container_name: postgres container_name: postgres
volumes: volumes:
- righttree-postgres-data:/var/lib/postgresql/data - righttree-postgres-data:/var/lib/postgresql/data
- ./create_database.sql:/docker-entrypoint-initdb.d/create_database.sql expose:
ports: - "5432"
- "5432:5432"
environment: environment:
- POSTGRES_DB=${POSTGRES_DB} - POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER} - POSTGRES_USER=${POSTGRES_USER}

View file

@ -9,6 +9,8 @@ x-django: &django
depends_on: depends_on:
postgres: postgres:
condition: service_healthy condition: service_healthy
redis:
condition: service_healthy
volumes: volumes:
- ./backend:/app - ./backend:/app
env_file: .env env_file: .env

View file

@ -28,9 +28,5 @@ http {
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade; proxy_cache_bypass $http_upgrade;
} }
location ~* \.(eot|otf|ttf|woff|woff2)$ {
add_header Access-Control-Allow-Origin *;
}
} }
} }

View file

@ -4,22 +4,23 @@ http {
server_name _; server_name _;
return 301 https://$host$request_uri; return 301 https://$host$request_uri;
} }
server { server {
listen 443 ssl; listen 443 ssl;
index index.html; index index.html;
include /etc/nginx/mime.types; include /etc/nginx/mime.types;
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
ssl_certificate /etc/letsencrypt/live/rightplant.biospherecapital.com/fullchain.pem; ssl_certificate /etc/letsencrypt/live/rightplant.biospherecapital.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/rightplant.biospherecapital.com/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/rightplant.biospherecapital.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/rightplant.biospherecapital.com/chain.pem; ssl_trusted_certificate /etc/letsencrypt/live/rightplant.biospherecapital.com/chain.pem;
location / { location / {
root /etc/nginx/html/build; root /etc/nginx/html/build;
} }
location /staticfiles { location /staticfiles {
root /etc/nginx/html/; root /etc/nginx/html/;
} }
location ~* ^/(api|admin) { location ~* ^/(api|admin) {