2.1 KiB
Executable File
Queensway Europe Telco Portal - Docker
The Docker stack contains two services:
telcoportal- the Flask web applicationdb- PostgreSQL 16, stored in a persistent Docker volume
First start and SQLite import
-
The legacy SQLite database is included at
data/telco.dband packaged into the application image, so Git-based deployments receive the import source without a host bind mount. -
Optionally set a database password in a
.envfile:TELCO_DB_PASSWORD=replace-with-a-long-random-password -
Build and start the stack:
docker compose up -d --build -
Open http://localhost:8092/.
Before the web server starts, migrate_sqlite.py creates the PostgreSQL schema and copies all
rows from users, phones, and internet_connections. IDs, password hashes, dates, comments,
and timestamps are retained. The import runs only while PostgreSQL has no application rows; all
later starts skip it without changing existing data.
If data/telco.db is missing on the first start, the app exits instead of creating an empty
production database. Check the reason with docker compose logs telcoportal.
After a successful import, the SQLite file is no longer used by the application. Keep an offline backup until the migrated data has been checked.
Persistent data and backups
PostgreSQL stores its files in the Docker named volume telco-db-data. Rebuilding or replacing
the containers does not delete this volume. The generated Flask session key is kept separately
in telco-app-data.
Create a portable SQL backup:
docker compose exec -T db pg_dump -U telco -d telco -Fc > telco-backup.dump
docker compose down keeps both volumes. Do not use docker compose down -v unless you
intend to delete the PostgreSQL database and application state.
Common commands
docker compose ps
docker compose logs -f telcoportal
docker compose logs -f db
docker compose down
docker compose up -d
docker compose up -d --build
To use another web port, change "8092:8000" in docker-compose.yml and recreate the stack.