diff --git a/Dockerfile b/Dockerfile index 53123e8..88badea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,9 @@ -FROM greyltc/archlinux-aur +FROM greyltc/archlinux-aur:yay WORKDIR /alkator COPY . . -EXPOSE 8002 run pacman -Syu python python-weasyprint python-dateutil python-django npm --noconfirm RUN sudo -u ab -D~ bash -c 'yay -Syu --removemake --needed --noprogressbar --noconfirm python-daphne' -CMD ["/usr/bin/daphne", "alkator.asgi:application", "-p", "8002"] \ No newline at end of file +RUN cd frontent && npm install && npm run build && rm -rf node_modules && cd .. +RUN python manage.py collectstatic +EXPOSE 8002 +CMD ["/usr/bin/daphne", "alkator.asgi:application", "-p", "8002"] diff --git a/alkator/urls.py b/alkator/urls.py index afb9835..744b6ed 100644 --- a/alkator/urls.py +++ b/alkator/urls.py @@ -16,6 +16,7 @@ Including another URLconf """ from django.contrib import admin from django.urls import path +from django.conf.urls.static import static from alkatorapi.views import ( register_user, register_racer, login, logout, @@ -51,4 +52,4 @@ urlpatterns = [ path('api/cart/select_delivery', select_delivery), path('api/cart/delivery', delivery), path('api/forgotten_password', forgotten_password), -] +] + static('/', document_root='frontend/build')