Compare commits

..

5 Commits

6 changed files with 16 additions and 9 deletions

1
.dockerignore Normal file
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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