Merge branch 'develop' of github.com:brortao/fediverse.space into develop

This commit is contained in:
Tao Bror Bojlén 2019-02-20 20:06:55 +00:00
commit 145e4cea08
No known key found for this signature in database
GPG key ID: C6EC7AAB905F9E6F
4 changed files with 45 additions and 36 deletions

View file

@ -6,6 +6,5 @@ ALLOWED_HOSTS = ['api.fediverse.space']
CORS_ORIGIN_WHITELIST = [ CORS_ORIGIN_WHITELIST = [
'fediverse.space', 'fediverse.space',
'www.fediverse.space',
'staging.fediverse.space' 'staging.fediverse.space'
] ]

View file

@ -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.
}

View file

@ -1,9 +1,42 @@
version: '3' version: '3'
services: 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
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: db:
restart: always restart: always
networks: networks:
- database_network - database_network
depends_on:
- letsencrypt
web: web:
restart: always restart: always
volumes: volumes:
@ -15,20 +48,9 @@ services:
environment: environment:
- ENVIRONMENT=production - ENVIRONMENT=production
- DJANGO_SETTINGS_MODULE=backend.settings.production - DJANGO_SETTINGS_MODULE=backend.settings.production
nginx: - VIRTUAL_HOST
image: nginx:1.14 - LETSENCRYPT_HOST
# build: - LETSENCRYPT_EMAIL
# 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
networks: networks:
database_network: database_network:
driver: bridge driver: bridge
@ -36,3 +58,8 @@ networks:
driver: bridge driver: bridge
volumes: volumes:
gunicorn-socket: gunicorn-socket:
conf:
vhost:
html:
certs:

View file

@ -3,3 +3,6 @@ POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres POSTGRES_PASSWORD=postgres
POSTGRES_DB=fediverse POSTGRES_DB=fediverse
DJANGO_SETTINGS_MODULE=backend.settings.development DJANGO_SETTINGS_MODULE=backend.settings.development
VIRTUAL_HOST=api.fediverse.space
LETSENCRYPT_HOST=api.fediverse.space
LETSENCRYPT_EMAIL=my@email.com