Get site running on staging domain.
This commit is contained in:
parent
4be5e93c9c
commit
7ba077608c
5 changed files with 49 additions and 11 deletions
|
@ -13,16 +13,40 @@ services:
|
||||||
env_file:
|
env_file:
|
||||||
- ./.env.prod
|
- ./.env.prod
|
||||||
|
|
||||||
nginx:
|
nginx-proxy:
|
||||||
|
container_name: nginx-proxy
|
||||||
build: ./nginx
|
build: ./nginx
|
||||||
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- 8080:80
|
- 443:443
|
||||||
|
- 80:80
|
||||||
volumes:
|
volumes:
|
||||||
- static_volume:/staticfiles
|
- static_volume:/staticfiles
|
||||||
- media_volume:/mediafiles
|
- media_volume:/mediafiles
|
||||||
|
- certs:/etc/nginx/certs
|
||||||
|
- html:/usr/share/nginx/html
|
||||||
|
- vhost:/etc/nginx/vhost.d
|
||||||
|
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||||
depends_on:
|
depends_on:
|
||||||
- web
|
- web
|
||||||
|
|
||||||
|
acme-companion:
|
||||||
|
image: docker.io/nginxproxy/acme-companion
|
||||||
|
env_file:
|
||||||
|
- ./.env.prod.proxy-companion
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
|
- certs:/etc/nginx/certs
|
||||||
|
- html:/usr/share/nginx/html
|
||||||
|
- vhost:/etc/nginx/vhost.d
|
||||||
|
- acme:/etc/acme.sh
|
||||||
|
depends_on:
|
||||||
|
- nginx-proxy
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
static_volume:
|
static_volume:
|
||||||
media_volume:
|
media_volume:
|
||||||
|
certs:
|
||||||
|
html:
|
||||||
|
vhost:
|
||||||
|
acme:
|
|
@ -19,19 +19,19 @@ services:
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- 443:443
|
- 443:443
|
||||||
- 8080:80
|
- 80:80
|
||||||
volumes:
|
volumes:
|
||||||
- static_volume:/staticfiles
|
- static_volume:/staticfiles
|
||||||
- media_volume:/mediafiles
|
- media_volume:/mediafiles
|
||||||
- certs:/etc/nginx/certs
|
- certs:/etc/nginx/certs
|
||||||
- html:/usr/share/nginx/html
|
- html:/usr/share/nginx/html
|
||||||
- vhost:/etc/nginx/vhost.d
|
- vhost:/etc/nginx/vhost.d
|
||||||
- /var/run/docker.sock:/tmp/docker/sock:ro
|
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||||
depends_on:
|
depends_on:
|
||||||
- web
|
- web
|
||||||
|
|
||||||
acme-companion:
|
acme-companion:
|
||||||
image: nginxproxy/acme-companion
|
image: docker.io/nginxproxy/acme-companion
|
||||||
env_file:
|
env_file:
|
||||||
- ./.env.staging.proxy-companion
|
- ./.env.staging.proxy-companion
|
||||||
volumes:
|
volumes:
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
FROM docker.io/nginxproxy/nginx-proxy
|
FROM docker.io/nginxproxy/nginx-proxy
|
||||||
|
|
||||||
COPY vhost.d/default /etc/nginx/vhost.d/default
|
COPY vhost.d/default /etc/nginx/vhost.d/default
|
||||||
COPY custom.conf /etc/nginx/conf.d/custom.conf
|
COPY custom.conf /etc/nginx/conf.d/custom.conf
|
|
@ -3,4 +3,5 @@
|
||||||
content="width=device-width, initial-scale=1">
|
content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
{% load static %}
|
{% load static %}
|
||||||
|
<link rel="shortcut icon" type="image/png" href="{% static 'primary/favicon.ico' %}"/>
|
||||||
<link rel="stylesheet" href="{% static 'primary/style.css' %}">
|
<link rel="stylesheet" href="{% static 'primary/style.css' %}">
|
|
@ -22,8 +22,10 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
|
||||||
SECRET_KEY = os.environ.get("SECRET_KEY")
|
SECRET_KEY = os.environ.get("SECRET_KEY")
|
||||||
|
|
||||||
DEBUG = bool(os.environ.get("DEBUG", default=0))
|
#DEBUG = bool(os.environ.get("DEBUG", default=0))
|
||||||
|
#DEBUG=True
|
||||||
|
|
||||||
|
if "DJANGO_ALLOWED_HOSTS" in os.environ:
|
||||||
ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS").split(" ")
|
ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS").split(" ")
|
||||||
|
|
||||||
|
|
||||||
|
@ -112,6 +114,8 @@ USE_I18N = True
|
||||||
USE_TZ = True
|
USE_TZ = True
|
||||||
|
|
||||||
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
|
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
|
||||||
|
|
||||||
|
if "CSRF_TRUSTED_ORIGINS" in os.environ:
|
||||||
CSRF_TRUSTED_ORIGINS = os.environ.get("CSRF_TRUSTED_ORIGINS").split(" ")
|
CSRF_TRUSTED_ORIGINS = os.environ.get("CSRF_TRUSTED_ORIGINS").split(" ")
|
||||||
|
|
||||||
|
|
||||||
|
@ -119,9 +123,17 @@ CSRF_TRUSTED_ORIGINS = os.environ.get("CSRF_TRUSTED_ORIGINS").split(" ")
|
||||||
# https://docs.djangoproject.com/en/5.0/howto/static-files/
|
# https://docs.djangoproject.com/en/5.0/howto/static-files/
|
||||||
|
|
||||||
STATIC_URL = 'static/'
|
STATIC_URL = 'static/'
|
||||||
|
|
||||||
|
if "DJANGO_STATIC_ROOT" in os.environ:
|
||||||
|
STATIC_ROOT = os.environ.get("DJANGO_STATIC_ROOT")
|
||||||
|
else:
|
||||||
STATIC_ROOT = BASE_DIR / "staticfiles"
|
STATIC_ROOT = BASE_DIR / "staticfiles"
|
||||||
|
|
||||||
MEDIA_URL = 'media/'
|
MEDIA_URL = 'media/'
|
||||||
|
|
||||||
|
if "DJANGO_MEDIA_ROOT" in os.environ:
|
||||||
|
MEDIA_ROOT = os.environ.get("DJANGO_MEDIA_ROOT")
|
||||||
|
else:
|
||||||
MEDIA_ROOT = BASE_DIR / "mediafiles"
|
MEDIA_ROOT = BASE_DIR / "mediafiles"
|
||||||
|
|
||||||
# Default primary key field type
|
# Default primary key field type
|
||||||
|
|
Loading…
Reference in a new issue