Skip to content
Snippets Groups Projects
Commit 4495d530 authored by Neblina xyz's avatar Neblina xyz
Browse files

Fix use of variables

* Wasn't using static_root and media_root properly: nginx was unaware of
  the folders (unless the hardcoded name "static" or "media" was used)
* There is a difference between the project name (of your choosing,
  which will be used to name folders in the server) and the name of the
  django project (the one gunicorn will use to call you project). We now
  differentiate both.
parent b5cdffe5
No related branches found
No related tags found
No related merge requests found
...@@ -3,11 +3,11 @@ version: '3.8' ...@@ -3,11 +3,11 @@ version: '3.8'
services: services:
web: web:
build: . build: .
command: gunicorn {{ project_name }}.wsgi:application --bind 0.0.0.0:8000 command: gunicorn {{ django_project_name }}.wsgi:application --bind 0.0.0.0:8000
volumes: volumes:
- ./{{ project_name}}/:/usr/src/{{ project_name }}/ - ./{{ project_name}}/:/usr/src/{{ project_name }}/
- static_volume:/usr/src/{{ project_name }}/static - static_volume:/usr/src/{{ project_name }}/{{ static_foler }}
- media_volume:/usr/src/{{ project_name }}/media - media_volume:/usr/src/{{ project_name }}/{{ media_folder }}
expose: expose:
- 8000 - 8000
env_file: env_file:
...@@ -25,8 +25,8 @@ services: ...@@ -25,8 +25,8 @@ services:
nginx: nginx:
build: ./nginx build: ./nginx
volumes: volumes:
- static_volume:/usr/src/{{ project_name }}/static - static_volume:/usr/src/{{ project_name }}/{{ static_folder }}
- media_volume:/usr/src/{{ project_name }}/media - media_volume:/usr/src/{{ project_name }}/{{ media_folder }}
ports: ports:
- {{ nginx_exposed_port }}:80 - {{ nginx_exposed_port }}:80
depends_on: depends_on:
......
...@@ -5,7 +5,8 @@ server_user: user ...@@ -5,7 +5,8 @@ server_user: user
nginx_exposed_port: 1337 nginx_exposed_port: 1337
# Project configuration # Project configuration
project_name: app project_name: app # Choose arbitrarily
django_project_name # Must be the same as in django configuration
git_repo: https://github.com/myself/app git_repo: https://github.com/myself/app
git_branch: main git_branch: main
debug: 0 debug: 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment