Skip to content
Snippets Groups Projects
Commit 1c11b4ec authored by Tim G's avatar Tim G
Browse files

Fixed staticfiles settings (entrypoint + nginx config + Django config)

parent e27e6015
No related branches found
Tags 0.4.1
No related merge requests found
......@@ -62,11 +62,6 @@ TEMPLATES = [
},
}
]
STATIC_URL = "web/static/"
# STATIC_ROOT = 'static'
STATICFILES_DIRS = [BASE_DIR / "static"]
WSGI_APPLICATION = "anthology.wsgi.application"
......@@ -133,12 +128,6 @@ USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_URL = "/static/"
AUTH_USER_MODEL = "meleager_user.User"
CACHES = {
......
from .antholont import *
ALLOWED_HOSTS = ["prod-ap.ecrituresnumeriques.ca", "anthologiagraeca.org"]
STATIC_URL = '/static/'
STATIC_ROOT = '/static'
# STATICFILES_DIRS = [BASE_DIR / "static"]
SECRET_KEY="|WA82LPB9NOKQSk*XJu0^B(+bi^Uih?6vt><PE!*fXz3&mVkw=q*^^)X3Xz_<*!U5.X%mdT}^BZ;8(c~w%YNv5 k?3wQ HK/W+nW~E8R3}^meSO}@L:y?pa5vyA z+ha"
\ No newline at end of file
......@@ -2,11 +2,11 @@ version: '3.1'
services:
db:
container_name: ap_db
container_name: ap_db_prd
image: mdillon/postgis
restart: always
volumes:
- ./initdb:/docker-entrypoint-initdb.d
- ./src/initdb:/docker-entrypoint-initdb.d
- ./persistent_db:/var/lib/postgresql
networks:
- default
......@@ -15,31 +15,37 @@ services:
POSTGRES_USER: anthology_django
POSTGRES_PASSWORD: password
http:
container_name: ap_http
container_name: ap_http_prd
restart: always
image: nginx
depends_on:
- app
volumes:
- ./docker/nginx.conf:/etc/nginx/conf.d/default.conf
- ./src/docker/nginx.conf:/etc/nginx/conf.d/default.conf
- ap_static:/static
networks:
- default
- traefik
labels:
- 'traefik.enable=true'
- 'traefik.backend=ap_http'
- 'traefik.backend=ap_http_prd'
- 'traefik.port=80'
- 'traefik.docker.network=traefik_net'
- 'traefik.frontend.rule=Host:prod-ap.ecrituresnumeriques.ca'
app:
container_name: ap_python
container_name: ap_python_prd
restart: always
image: timoguic/antholont:stable
environment:
- DJANGO_SETTINGS_MODULE=anthology.settings.prod
volumes:
- ap_static:/static
depends_on:
- db
networks:
- default
volumes:
ap_static:
networks:
default:
driver:
......
......@@ -8,5 +8,4 @@ COPY requirements.txt /requirements.txt
RUN python -m pip install -r /requirements.txt
RUN mkdir -p /import && chmod -R 777 /import && mkdir /code
WORKDIR /code
VOLUME /code
\ No newline at end of file
WORKDIR /code
\ No newline at end of file
......@@ -7,8 +7,13 @@ server {
#access_log /var/log/nginx/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
proxy_pass http://app:8000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /static {
alias /static;
}
location /docs {
......
......@@ -2,5 +2,6 @@
set -ex
cd /code
python manage.py migrate
python manage.py compilemessages
python manage.py compilemessages --noinput
python manage.py collectstatic --noinput
python -m gunicorn -b 0.0.0.0:8000 anthology.wsgi
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment