Skip to content

Commit

Permalink
Added nginx for docker-compose.
Browse files Browse the repository at this point in the history
  • Loading branch information
marvintensuan committed Nov 20, 2020
1 parent 6885ef7 commit a7b826b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
4 changes: 3 additions & 1 deletion backend/backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,6 @@

STATIC_URL = '/static/'

STATIC_ROOT = BASE_DIR / 'myportfolio/static'
# STATIC_ROOT = BASE_DIR / 'myportfolio/static'

STATIC_ROOT = '/static/'
1 change: 0 additions & 1 deletion backend/backend/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@
urlpatterns = [
path('admin/', admin.site.urls),
path('', home)

]
18 changes: 17 additions & 1 deletion backend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@ version: "3.8"
services:
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
command: >
gunicorn backend.wsgi:application --bind 0.0.0.0:8000 --workers=4
ports:
- "8000:8000"
volumes:
- static:/static/
nginx:
build: ./nginx
container_name: nginx
image: nginx:mainline-alpine
restart: always
ports:
- "80:80"
volumes:
- static:/static
depends_on:
- web
volumes:
static:
Binary file added backend/nginx/nginx.conf
Binary file not shown.
Binary file modified backend/requirements.txt
Binary file not shown.

0 comments on commit a7b826b

Please sign in to comment.