Compare commits

..

No commits in common. "0d20b543b0294dcf5ee160419ba780eaa9e3120e" and "2939b4a5156838bbb5b399ebe40df536e6fbb052" have entirely different histories.

6 changed files with 9 additions and 16 deletions

View File

@ -1 +0,0 @@
src/web/static/*

View File

@ -6,11 +6,10 @@ RUN npm install && \
FROM python:3.10.9-alpine FROM python:3.10.9-alpine
ENV VERSION_NUMBER 0.1.1-8-gf7b69f7 ENV VERSION_NUMBER 0.1.1-3-gd029fda
ENV PROD 1 ENV PROD 1
RUN apk add \ RUN apk add \
bash \
vim \ vim \
curl \ curl \
caddy caddy

View File

@ -1,3 +1,5 @@
.PHONY: createsuperuser shell cleanstatic
all: css migrate all: css migrate
initialize: npm css migrate sethookdir loadplatforms initialize: npm css migrate sethookdir loadplatforms
@ -22,11 +24,8 @@ migrate: makemigrations
dev: migrate sethookdir dev: migrate sethookdir
poetry run python src/web/manage.py runserver_plus poetry run python src/web/manage.py runserver_plus
caddy:
caddy run --watch
dev-prod: migrate collectstatic sethookdir dev-prod: migrate collectstatic sethookdir
cd src/web/; PROD=1 poetry run python -m gunicorn --bind 0.0.0.0:8001 web.asgi:application -k uvicorn.workers.UvicornWorker cd src/web/; poetry run python -m gunicorn --bind 0.0.0.0:8001 web.asgi:application -k uvicorn.workers.UvicornWorker
dumptracker: dumptracker:
poetry run python src/web/manage.py dumpdata --format yaml tracker --output tracker_fixture.yaml poetry run python src/web/manage.py dumpdata --format yaml tracker --output tracker_fixture.yaml
@ -61,4 +60,4 @@ date:
cleanstatic: cleanstatic:
rm -r src/web/static/* rm -r src/web/static/*
clean: cleanstatic clean: cleanstatic

View File

@ -1,10 +1,9 @@
--- ---
version: "2.1"
services: services:
timetracker: timetracker:
image: registry.kucharczyk.xyz/timetracker image: registry.kucharczyk.xyz/timetracker
build: build: Dockerfile
context: .
dockerfile: Dockerfile
container_name: timetracker container_name: timetracker
environment: environment:
- TZ=Europe/Prague - TZ=Europe/Prague

View File

@ -8,6 +8,6 @@ echo "Collect static files"
poetry run python src/web/manage.py collectstatic poetry run python src/web/manage.py collectstatic
echo "Starting server" echo "Starting server"
caddy start caddy run
cd src/web || exit cd src/web || exit
poetry run python -m gunicorn --bind 0.0.0.0:8001 web.asgi:application -k uvicorn.workers.UvicornWorker poetry run python -m gunicorn --bind 0.0.0.0:8001 web.asgi:application -k uvicorn.workers.UvicornWorker

View File

@ -16,13 +16,10 @@ Including another URLconf
from django.contrib import admin from django.contrib import admin
from django.urls import include, path from django.urls import include, path
from django.views.generic import RedirectView from django.views.generic import RedirectView
from django.conf import settings
urlpatterns = [ urlpatterns = [
path("admin/", admin.site.urls),
path("", RedirectView.as_view(url="/tracker/list-sessions")), path("", RedirectView.as_view(url="/tracker/list-sessions")),
path("tracker/", include("tracker.urls")), path("tracker/", include("tracker.urls")),
] ]
if settings.DEBUG:
urlpatterns.append(path("admin/", admin.site.urls))