Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ venv/
.idea/

# Logs
/logs
*.log
*.pot
*.mo
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ RUN pip install --upgrade pip \
# Copy the rest of the application code
COPY . .

# Install static files
RUN python manage.py collectstatic --noinput

# Expose Django port
EXPOSE 8000

Expand Down
5 changes: 4 additions & 1 deletion TaskManagerSystem/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
from django.urls import path, include
from decouple import config

Expand Down Expand Up @@ -44,4 +45,6 @@
# Swagger & ReDoc
path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
path('redoc/', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
]
]

urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
6 changes: 5 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ services:
web:
build: .
container_name: taskmanagersystem
command: gunicorn TaskManagerSystem.wsgi:application --bind 0.0.0.0:8000
command: >
sh -c "
python manage.py collectstatic --noinput &&
gunicorn TaskManagerSystem.wsgi:application --bind 0.0.0.0:8000"
ports:
- "8000:8000"
volumes:
- .:/app
- ./staticfiles:/app/staticfiles
env_file:
- .env.docker
depends_on:
Expand Down