Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Sistem Informasi Zakat
Sizakat 5.0 (Refactoring)
Sizakat Backend
Commits
3cb5b2f0
Commit
3cb5b2f0
authored
Aug 17, 2020
by
hashlash
Browse files
[CHORES] add nginx to serve static files
parent
0a3b8c7e
Changes
3
Hide whitespace changes
Inline
Side-by-side
docker-compose.yml
View file @
3cb5b2f0
version
:
'
3.7'
services
:
nginx
:
image
:
nginx:stable
restart
:
always
ports
:
-
${BACKEND_PORT:-8000}:80
volumes
:
-
./nginx/default.conf:/etc/nginx/conf.d/default.conf
-
staticfiles:/var/www/html/static/
depends_on
:
-
backend
backend
:
build
:
context
:
./
...
...
@@ -8,8 +18,7 @@ services:
command
:
gunicorn sizakat.wsgi --bind 0.0.0.0:8000 --log-file -
volumes
:
-
./:/app/backend/
ports
:
-
${BACKEND_PORT:-8000}:8000
-
staticfiles:/app/backend/staticfiles/
env_file
:
-
.env
depends_on
:
...
...
@@ -24,3 +33,4 @@ services:
volumes
:
postgres_data
:
staticfiles
:
entrypoint.sh
View file @
3cb5b2f0
...
...
@@ -11,6 +11,7 @@ then
echo
"PostgreSQL started"
fi
python manage.py collectstatic
--no-input
python manage.py migrate
exec
"
$@
"
nginx/default.conf
0 → 100644
View file @
3cb5b2f0
server
{
listen
80
;
location
/
static
/ {
root
/
var
/
www
/
html
/;
}
location
/ {
proxy_pass
http
://
backend
:
8000
;
proxy_set_header
Host
$
http_host
;
proxy_set_header
X
-
Real
-
IP
$
remote_addr
;
proxy_set_header
X
-
Forwarded
-
For
$
proxy_add_x_forwarded_for
;
proxy_set_header
X
-
Forwarded
-
Proto
$
scheme
;
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment