Merge branch 'production' of github.com:brortao/fediverse.space into production
This commit is contained in:
commit
4a76c856d3
|
@ -23,8 +23,11 @@ The map of the fediverse that you always wanted.
|
|||
|
||||
## Commands
|
||||
### Backend
|
||||
- `python manage.py scrape` scrapes the entire fediverse
|
||||
- `python manage.py build_graph` uses this information to lay out a graph
|
||||
|
||||
After running the backend in Docker:
|
||||
|
||||
- `docker-compose exec web python manage.py scrape` scrapes the entire fediverse
|
||||
- `docker-compose exec web python manage.py build_graph` uses this information to lay out a graph
|
||||
|
||||
To run in production, use `docker-compose -f docker-compose.yml -f docker-compose.production.yml` instead of just `docker-compose`.
|
||||
|
||||
|
|
|
@ -2,10 +2,9 @@ from .base import *
|
|||
|
||||
DEBUG = False
|
||||
|
||||
ALLOWED_HOSTS = ['fediverse.space', 'www.fediverse.space', 'staging.fediverse.space']
|
||||
ALLOWED_HOSTS = ['api.fediverse.space']
|
||||
|
||||
CORS_ORIGIN_WHITELIST = [
|
||||
'fediverse.space',
|
||||
'www.fediverse.space',
|
||||
'staging.fediverse.space'
|
||||
]
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
upstream app {
|
||||
server unix:/var/gunicorn/.sock;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
allow all;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Cluster-Client-Ip $remote_addr;
|
||||
proxy_pass http://app;
|
||||
}
|
||||
|
||||
# Note that nginx doesn't serve any static files.
|
||||
}
|
||||
|
|
@ -1,9 +1,43 @@
|
|||
version: '3'
|
||||
services:
|
||||
nginx-proxy:
|
||||
image: jwilder/nginx-proxy:alpine
|
||||
restart: always
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
labels:
|
||||
- com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy
|
||||
volumes:
|
||||
- gunicorn-socket:/var/gunicorn # to talk to Django
|
||||
- /var/run/docker.sock:/tmp/docker.sock:ro # for nginx-proxy
|
||||
- conf:/etc/nginx/conf.d
|
||||
- vhost:/etc/nginx/vhost.d
|
||||
- html:/usr/share/nginx/html
|
||||
- certs:/etc/nginx/certs:ro
|
||||
networks:
|
||||
- nginx_network
|
||||
letsencrypt:
|
||||
image: jrcs/letsencrypt-nginx-proxy-companion
|
||||
restart: always
|
||||
container_name: nginx-proxy-le
|
||||
volumes:
|
||||
- gunicorn-socket:/var/gunicorn
|
||||
- conf:/etc/nginx/conf.d
|
||||
- vhost:/etc/nginx/vhost.d
|
||||
- html:/usr/share/nginx/html
|
||||
- certs:/etc/nginx/certs:rw
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
networks:
|
||||
- nginx_network
|
||||
depends_on:
|
||||
- nginx-proxy
|
||||
db:
|
||||
restart: always
|
||||
networks:
|
||||
- database_network
|
||||
depends_on:
|
||||
- letsencrypt
|
||||
web:
|
||||
restart: always
|
||||
volumes:
|
||||
|
@ -15,24 +49,18 @@ services:
|
|||
environment:
|
||||
- ENVIRONMENT=production
|
||||
- DJANGO_SETTINGS_MODULE=backend.settings.production
|
||||
nginx:
|
||||
image: nginx:1.14
|
||||
# build:
|
||||
# context: .
|
||||
# dockerfile: Dockerfile.nginx
|
||||
ports:
|
||||
- "80:80"
|
||||
volumes:
|
||||
- gunicorn-socket:/var/gunicorn
|
||||
- ./config/nginx/conf.d:/etc/nginx/conf.d
|
||||
networks:
|
||||
- nginx_network
|
||||
depends_on:
|
||||
- web
|
||||
- VIRTUAL_HOST
|
||||
- LETSENCRYPT_HOST
|
||||
- LETSENCRYPT_EMAIL
|
||||
networks:
|
||||
database_network:
|
||||
driver: bridge
|
||||
nginx_network:
|
||||
driver: bridge
|
||||
volumes:
|
||||
gunicorn-socket:
|
||||
gunicorn-socket:
|
||||
conf:
|
||||
vhost:
|
||||
html:
|
||||
certs:
|
||||
|
||||
|
|
|
@ -3,3 +3,6 @@ POSTGRES_USER=postgres
|
|||
POSTGRES_PASSWORD=postgres
|
||||
POSTGRES_DB=fediverse
|
||||
DJANGO_SETTINGS_MODULE=backend.settings.development
|
||||
VIRTUAL_HOST=api.fediverse.space
|
||||
LETSENCRYPT_HOST=api.fediverse.space
|
||||
LETSENCRYPT_EMAIL=my@email.com
|
||||
|
|
Loading…
Reference in a new issue