Compare commits
5 Commits
2939b4a515
...
0d20b543b0
Author | SHA1 | Date |
---|---|---|
Lukáš Kucharczyk | 0d20b543b0 | |
Lukáš Kucharczyk | f7b69f7704 | |
Lukáš Kucharczyk | 1ccfdc321a | |
Lukáš Kucharczyk | 25a58c2732 | |
Lukáš Kucharczyk | 270d9f7296 |
|
@ -0,0 +1 @@
|
||||||
|
src/web/static/*
|
|
@ -6,10 +6,11 @@ RUN npm install && \
|
||||||
|
|
||||||
FROM python:3.10.9-alpine
|
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
|
ENV PROD 1
|
||||||
|
|
||||||
RUN apk add \
|
RUN apk add \
|
||||||
|
bash \
|
||||||
vim \
|
vim \
|
||||||
curl \
|
curl \
|
||||||
caddy
|
caddy
|
||||||
|
|
9
Makefile
9
Makefile
|
@ -1,5 +1,3 @@
|
||||||
.PHONY: createsuperuser shell cleanstatic
|
|
||||||
|
|
||||||
all: css migrate
|
all: css migrate
|
||||||
|
|
||||||
initialize: npm css migrate sethookdir loadplatforms
|
initialize: npm css migrate sethookdir loadplatforms
|
||||||
|
@ -24,8 +22,11 @@ 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/; 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:
|
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
|
||||||
|
@ -60,4 +61,4 @@ date:
|
||||||
cleanstatic:
|
cleanstatic:
|
||||||
rm -r src/web/static/*
|
rm -r src/web/static/*
|
||||||
|
|
||||||
clean: cleanstatic
|
clean: cleanstatic
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
---
|
---
|
||||||
version: "2.1"
|
|
||||||
services:
|
services:
|
||||||
timetracker:
|
timetracker:
|
||||||
image: registry.kucharczyk.xyz/timetracker
|
image: registry.kucharczyk.xyz/timetracker
|
||||||
build: Dockerfile
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
container_name: timetracker
|
container_name: timetracker
|
||||||
environment:
|
environment:
|
||||||
- TZ=Europe/Prague
|
- TZ=Europe/Prague
|
||||||
|
|
|
@ -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 run
|
caddy start
|
||||||
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
|
||||||
|
|
|
@ -16,10 +16,13 @@ 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))
|
||||||
|
|
Loading…
Reference in New Issue