Clean-up,readme
This commit is contained in:
parent
701c638140
commit
b36cd5d1b0
|
|
@ -9,7 +9,8 @@ WORKDIR /app
|
|||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
COPY src/ .
|
||||
|
||||
|
||||
RUN mkdir -p /data
|
||||
VOLUME ["/data"]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
# queue.hswro.org website - a simple queue managemet system:
|
||||
|
||||
- People receive physical tokens with numbers on them.
|
||||
- Operator:
|
||||
- Adds numbers to the list of tokens issued.
|
||||
- Selects numbers from the list to be called.
|
||||
- Removes the called number from the list or moves it back to the queue.
|
||||
|
||||
## Common tasks
|
||||
|
||||
### Testing the website locally
|
||||
|
||||
In the repo directory:
|
||||
|
||||
```
|
||||
docker build -t queue-app:latest .
|
||||
docker run -p="5000:5000" --volume="$PWD:/data:" -it queue-app:latest
|
||||
```
|
||||
|
||||
Preview should be available on:
|
||||
`http://localhost:5000` - end user access
|
||||
`http://localhost:5000/admin` - operator access
|
||||
|
||||
|
|
@ -2,16 +2,40 @@ version: "3.8"
|
|||
|
||||
services:
|
||||
queue:
|
||||
image: "queue-app:latest" # zmień na registry/name:tag jeśli pobierasz z rejestru
|
||||
ports: 5000
|
||||
image: "queue-app:latest"
|
||||
ports:
|
||||
- 5000
|
||||
volumes:
|
||||
- queue_data:/data
|
||||
environment:
|
||||
- DB_PATH=/data/queue.db
|
||||
- ADMIN_URL=admin-panel
|
||||
restart: always
|
||||
- ADMIN_URL=secret-admin-panel
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- web
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '2.0'
|
||||
memory: 512M
|
||||
mode: replicated
|
||||
replicas: 1
|
||||
placement:
|
||||
constraints: [node.role == manager]
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.docker.network=web"
|
||||
- "traefik.http.routers.queue.rule=Host(`domain.tld`)"
|
||||
- "traefik.http.routers.queue.entrypoints=websecure"
|
||||
- "traefik.http.services.queue.loadbalancer.server.port=5000"
|
||||
- "traefik.http.routers.queue.tls=true"
|
||||
- "traefik.http.routers.queue.tls.certresolver=myresolver"
|
||||
|
||||
|
||||
volumes:
|
||||
queue_data:
|
||||
|
||||
networks:
|
||||
web:
|
||||
external:
|
||||
name: web
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ from flask import Flask, render_template, request, redirect, url_for, g, jsonify
|
|||
import sqlite3
|
||||
import os
|
||||
|
||||
|
||||
DB = os.environ.get("DB_PATH", "queue.db")
|
||||
ADMIN_SUFFIX = os.environ.get("ADMIN_URL", "admin").strip("/")
|
||||
ADMIN_PATH = f"/{ADMIN_SUFFIX}" if ADMIN_SUFFIX else "/admin"
|
||||
|
|
@ -38,11 +38,11 @@
|
|||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Zapraszamy do stanowiska osoby z numerem:</h1>
|
||||
<h1>Zapraszamy do stanowiska osoby z numerami:</h1>
|
||||
<div id="nums">-</div>
|
||||
|
||||
<div id="waiting" style="margin-top:18px;color:#333">
|
||||
<h3>Liczba osób oczekujących: <span id="waiting-count">0</span></h3>
|
||||
<h3>Wszystkich osób oczekujących: <span id="waiting-count">0</span></h3>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
Loading…
Reference in New Issue