Explorar el Código

feat: Initial commit

Joost Sijm hace 9 meses
commit
57531c7dd8
Se han modificado 7 ficheros con 60 adiciones y 0 borrados
  1. 0 0
      .gitignore
  2. 23 0
      Dockerfile
  3. 5 0
      Makefile
  4. 2 0
      README.md
  5. 7 0
      docker-compose.base.yaml
  6. 9 0
      docker-compose.yaml
  7. 14 0
      pyproject.toml

+ 0 - 0
.gitignore


+ 23 - 0
Dockerfile

@@ -0,0 +1,23 @@
+FROM python:3.12-alpine as base 
+
+ENV LANG=C.UTF-8
+ENV LC_ALL=C.UTF-8
+ENV PYTHONUNBUFFERED=1
+
+RUN adduser --system --no-create-home kinema-zetel
+RUN mkdir /app
+WORKDIR /app
+RUN --mount=type=cache,target=/root/.cache/pip pip install -U pip pip-tools
+USER root
+
+FROM base as prod
+COPY requirements.txt /app/requirements.txt
+RUN pip install -r requirements.txt
+RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt
+COPY . .
+RUN --mount=type=cache,target=/root/.cache/pip pip install -e . --no-deps
+USER kinema-zetel 
+CMD [ "python", "-m", "kinema-zetel"]
+
+from prod as dev
+USER root

+ 5 - 0
Makefile

@@ -0,0 +1,5 @@
+DOCKER := $(shell command -v docker 2> /dev/null)
+
+requirements.txt: pyproject.toml
+	$(DOCKER) compose -f docker-compose.base.yaml run --rm app \
+		pip-compile --output-file requirements.txt pyproject.toml

+ 2 - 0
README.md

@@ -0,0 +1,2 @@
+# Kinema-zetel
+Application to periodically track and analyse seat occupation.

+ 7 - 0
docker-compose.base.yaml

@@ -0,0 +1,7 @@
+services:
+  app:
+    extends:
+      file: docker-compose.yaml
+      service: app
+    build:
+      target: base

+ 9 - 0
docker-compose.yaml

@@ -0,0 +1,9 @@
+version: "3.8"
+
+services:
+  app:
+    build:
+      context: .
+    image: kinema-zetel:latest
+    volumes:
+      - ./kinema-zetel:/app

+ 14 - 0
pyproject.toml

@@ -0,0 +1,14 @@
+[tool.poetry]
+name = "kinema-zetel"
+dynamic = ["version"]
+description = ""
+authors = ["Joost Sijm <joostsijm@gmail.com>"]
+readme = "README.md"
+dependencies = [
+    "pydantic==2.*",
+    "inject==4.*",
+    "asgiref",
+    "blinker",
+    "async-lru",
+    "backoff"
+]