From 1e491efb91fa5bcc0275e91e424bc1b18bd16b80 Mon Sep 17 00:00:00 2001 From: nough Date: Sat, 20 Dec 2025 20:29:07 +0000 Subject: [PATCH 01/14] get a podman container working --- Dockerfile | 13 +++++++++++++ docs/03_dockerfile | 5 +++++ hackspace_mgmt/admin/__init__.py | 4 +++- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 docs/03_dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2f86079 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +# syntax=docker/dockerfile:1 + +FROM python:latest +# WORKDIR /app +COPY . . +# RUN apt-get update && apt-get install -y python3.11 python3-pip +ENV PIP_ROOT_USER_ACTION=ignore +RUN pip install -r requirements.txt +ENV FLASK_APP hackspace_mgmt:create_app +#ENV FLASK_ENV development +EXPOSE 5000 +#CMD ["flask"] +ENTRYPOINT ["flask", "run", "--host=0.0.0.0", "--debug"] diff --git a/docs/03_dockerfile b/docs/03_dockerfile new file mode 100644 index 0000000..a86f290 --- /dev/null +++ b/docs/03_dockerfile @@ -0,0 +1,5 @@ +build with podman build -t hackspace-mgmt:latest . + +run with podman run --name hs-mgmt --network host --rm localhost/hackspace-mgmt:latest + +access on your web browser at localhost:5000 \ No newline at end of file diff --git a/hackspace_mgmt/admin/__init__.py b/hackspace_mgmt/admin/__init__.py index edf6954..81cf795 100644 --- a/hackspace_mgmt/admin/__init__.py +++ b/hackspace_mgmt/admin/__init__.py @@ -1,8 +1,10 @@ from flask_admin import Admin +from flask_admin.theme import Bootstrap4Theme from . import machine, induction, firmware_update, card, bulk_card, member, label, quiz, audit -admin = Admin(None, 'Hackspace Management Admin', template_mode='bootstrap4', endpoint="admin", url="/admin") +admin = Admin(None, 'Hackspace Management Admin', theme=Bootstrap4Theme(), endpoint="admin", url="/admin") + machine.create_views(admin) induction.create_views(admin) From 7053e9beec76875ebe603c3743ee126c168e9397 Mon Sep 17 00:00:00 2001 From: Nat Hough Date: Sun, 21 Dec 2025 09:54:19 +0000 Subject: [PATCH 02/14] various test changes --- hackspace_mgmt/admin/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hackspace_mgmt/admin/__init__.py b/hackspace_mgmt/admin/__init__.py index 81cf795..dd3452c 100644 --- a/hackspace_mgmt/admin/__init__.py +++ b/hackspace_mgmt/admin/__init__.py @@ -5,7 +5,6 @@ admin = Admin(None, 'Hackspace Management Admin', theme=Bootstrap4Theme(), endpoint="admin", url="/admin") - machine.create_views(admin) induction.create_views(admin) firmware_update.create_views(admin) @@ -14,4 +13,4 @@ member.create_views(admin) label.create_views(admin) quiz.create_views(admin) -audit.create_views(admin) \ No newline at end of file +audit.create_views(admin) From 52edd5e108f0ff4f646ec089a86915bc025844dd Mon Sep 17 00:00:00 2001 From: Nat Hough Date: Sun, 21 Dec 2025 10:55:51 +0000 Subject: [PATCH 03/14] added some more changes, documentation. --- docker-compose.yml | 39 ++++++++++++++++++++++++++++++++++++++ docs/01_dev_environment.md | 3 +++ 2 files changed, 42 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d5bfbe9 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,39 @@ +version: '3.8' + +services: + app: + build: + context: . + # dockerfile: .devcontainer/Dockerfile + ports: + - "5000:5000" + # volumes: + # - ../..:/workspaces:cached + + # Overrides default command so things don't shut down after the process ends. + # command: sleep infinity + + # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. + # network_mode: service:db + + # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. + # (Adding the "ports" property to this file will not forward from a Codespace.) + + db: + image: postgres:17 + restart: unless-stopped + volumes: + - postgres-data:/var/lib/postgresql/data + - ./migration:/testdata/migration:ro + environment: + POSTGRES_USER: postgres + POSTGRES_DB: postgres + POSTGRES_PASSWORD: postgres + ports: + - 5432:5432 + # Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally. + # (Adding the "ports" property to this file will not forward from a Codespace.) + +volumes: + postgres-data: + migration: diff --git a/docs/01_dev_environment.md b/docs/01_dev_environment.md index 0832f6f..d8d053d 100644 --- a/docs/01_dev_environment.md +++ b/docs/01_dev_environment.md @@ -15,10 +15,13 @@ Most of us use VsCode as a lightweight IDE. ### Database Setup +1. if you've run postgres in a container, first execute in to the container with `podman exec -it container_name sh` then become the postgres user with `su - postgres`. This wil then allow you to move on to the next step. 1. Connect to the database using `psql postgres` or using pgAdmin. 2. Create a database called `hackspace`. In psql, you can run the query `CREATE DATABASE hackspace;` (don't forget the semi-colon!). 3. Under the `hackspace-mgmt/migration` folder is a bunch of SQL scripts. Run these, in order, against the new hackspace database. In pgAdmin, you would right click on the database and open the `Query` tool. Then copy-paste in the contents of each file and run them one-by-one. +if you've connected to psql in a container, run each of these commands in a series: `postgres@564b3daf528f:/testdata/migration$ psql -d hackspace < 19_address_not_null.sql ` + If you had to change the username, then you'll want to create a postgres user. You can do this by right-clicking the server and then _Create->Login/Group role_. Name the role `postgres`, then on the _Priveleges_ tab, enable _Can Login_ and _Superuser_ (this isn't recommended for production, but fine for development). ### Webserver Setup From 930e8df7cbdb8027dee7421170468e55e88e7ded Mon Sep 17 00:00:00 2001 From: Nat Hough Date: Mon, 22 Dec 2025 17:45:12 +0000 Subject: [PATCH 04/14] uplift with Container changes --- hackspace_mgmt/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hackspace_mgmt/__init__.py b/hackspace_mgmt/__init__.py index ec68931..e7bcfba 100644 --- a/hackspace_mgmt/__init__.py +++ b/hackspace_mgmt/__init__.py @@ -8,7 +8,7 @@ def create_app(test_config=None): app = Flask(__name__, instance_relative_config=True) app.config.from_mapping( SECRET_KEY="dev", - SQLALCHEMY_DATABASE_URI="postgresql+psycopg2://postgres:postgres@localhost:5432/hackspace", + SQLALCHEMY_DATABASE_URI="postgresql+psycopg2://postgres:postgres@db:5432/hackspace", STORAGE_LOGIN_SECRET="dev", STORAGE_APP_URL="http://example.com" ) From 92e18c0d2878c17d2cbcfc6d11a95c5c483c8bb4 Mon Sep 17 00:00:00 2001 From: Nat Hough Date: Wed, 24 Dec 2025 13:10:10 +0000 Subject: [PATCH 05/14] uplift some documentation, attempt quadlet. Not tried the quadlet. --- docs/03_dockerfile | 5 ----- docs/03_dockerfile.md | 22 ++++++++++++++++++++++ quadlet/hackspace-mgmt.container | 12 ++++++++++++ 3 files changed, 34 insertions(+), 5 deletions(-) delete mode 100644 docs/03_dockerfile create mode 100644 docs/03_dockerfile.md create mode 100644 quadlet/hackspace-mgmt.container diff --git a/docs/03_dockerfile b/docs/03_dockerfile deleted file mode 100644 index a86f290..0000000 --- a/docs/03_dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -build with podman build -t hackspace-mgmt:latest . - -run with podman run --name hs-mgmt --network host --rm localhost/hackspace-mgmt:latest - -access on your web browser at localhost:5000 \ No newline at end of file diff --git a/docs/03_dockerfile.md b/docs/03_dockerfile.md new file mode 100644 index 0000000..237e19c --- /dev/null +++ b/docs/03_dockerfile.md @@ -0,0 +1,22 @@ +build with podman build -t hackspace-mgmt:latest . + +run with podman run --name hs-mgmt --network host --rm localhost/hackspace-mgmt:latest + +access on your web browser at localhost:5000 + +# Quadlet +https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html/building_running_and_managing_containers/assembly_porting-containers-to-systemd-using-podman_building-running-and-managing-containers + +Create the .container unit file in one of the following directories: + + For root users: /usr/share/containers/systemd/ or /etc/containers/systemd/ + For rootless users: $HOME/.config/containers/systemd/, $XDG_CONFIG_HOME/containers/systemd/, /etc/containers/systemd/users/$(UID), or /etc/containers/systemd/users/ + +The orchestration technology used in production is quadlet https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html +The two important settings for allowing the container to use the peer authentication with postgress are: + +``` +[container] +Annotation="run.oci.keep_original_groups=1" +UserNS=keep-id +``` diff --git a/quadlet/hackspace-mgmt.container b/quadlet/hackspace-mgmt.container new file mode 100644 index 0000000..9d0260e --- /dev/null +++ b/quadlet/hackspace-mgmt.container @@ -0,0 +1,12 @@ +[Unit] +Description=The hackspace-Mgmt container +After=local-fs.target +# May want to edit the After line to be e.g. after Postgres is available on other PC. + +[Container] +Image=registry.bristolhackspace.org/hackspace-mgmt:latest +# don't think we need an Exec= command + +[Install] +# Start by default on boot +WantedBy=multi-user.target default.target \ No newline at end of file From aa659476597582607c8419e4b7900cb9157d3a6e Mon Sep 17 00:00:00 2001 From: Nat Hough Date: Wed, 24 Dec 2025 17:14:01 +0000 Subject: [PATCH 06/14] add recommended code to allow connecting to psql --- quadlet/hackspace-mgmt.container | 2 ++ 1 file changed, 2 insertions(+) diff --git a/quadlet/hackspace-mgmt.container b/quadlet/hackspace-mgmt.container index 9d0260e..f92278f 100644 --- a/quadlet/hackspace-mgmt.container +++ b/quadlet/hackspace-mgmt.container @@ -6,6 +6,8 @@ After=local-fs.target [Container] Image=registry.bristolhackspace.org/hackspace-mgmt:latest # don't think we need an Exec= command +Annotation="run.oci.keep_original_groups=1" +UserNS=keep-id [Install] # Start by default on boot From 4e5dd190bbd72bd724f13a6ff624c29730eb631c Mon Sep 17 00:00:00 2001 From: Nat Hough Date: Wed, 24 Dec 2025 17:44:46 +0000 Subject: [PATCH 07/14] working as a quadlet service. --- quadlet/hackspace-mgmt.container | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/quadlet/hackspace-mgmt.container b/quadlet/hackspace-mgmt.container index f92278f..4443847 100644 --- a/quadlet/hackspace-mgmt.container +++ b/quadlet/hackspace-mgmt.container @@ -1,13 +1,22 @@ +# documentation: https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html + [Unit] Description=The hackspace-Mgmt container After=local-fs.target # May want to edit the After line to be e.g. after Postgres is available on other PC. [Container] -Image=registry.bristolhackspace.org/hackspace-mgmt:latest +Image=hackspace-mgmt:latest # don't think we need an Exec= command Annotation="run.oci.keep_original_groups=1" UserNS=keep-id +PublishPort=5000:5000 # change the first port to whatever you want it to be :). +# HostName=name +# IP=10.0.0.1 +# IPv6=2001::1 +# DNS= +# DNSOption= +# DNSSearch= [Install] # Start by default on boot From ec8a2305b99f888a50b15d19943ee4a7a100d0e9 Mon Sep 17 00:00:00 2001 From: Nat Hough Date: Wed, 24 Dec 2025 18:39:40 +0000 Subject: [PATCH 08/14] attempts to get mgmt running with a separate db on same server - not as part of docker-compose. --- docs/03_dockerfile.md | 7 +++++++ hackspace_mgmt/__init__.py | 3 ++- quadlet/hackspace-mgmt.container | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/03_dockerfile.md b/docs/03_dockerfile.md index 237e19c..c1f6ac8 100644 --- a/docs/03_dockerfile.md +++ b/docs/03_dockerfile.md @@ -5,6 +5,13 @@ run with podman run --name hs-mgmt --network host --rm localhost/hackspace-mgmt: access on your web browser at localhost:5000 # Quadlet +Copy the hackspace-mgmt.container file from `./quadlet/` to one of the locations mentioned below. +do a systemctl daemon-reload (whether as a root or as a `--user`) +do a systemctl start hackspace-mgmt.service (whether as a root or as a `--user`) +`systemctl [--user] status hackspace-mgmt.service` and `podman ps -a` to determine status. + +### Quadlet notes + https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html/building_running_and_managing_containers/assembly_porting-containers-to-systemd-using-podman_building-running-and-managing-containers Create the .container unit file in one of the following directories: diff --git a/hackspace_mgmt/__init__.py b/hackspace_mgmt/__init__.py index e7bcfba..a54bf24 100644 --- a/hackspace_mgmt/__init__.py +++ b/hackspace_mgmt/__init__.py @@ -8,7 +8,8 @@ def create_app(test_config=None): app = Flask(__name__, instance_relative_config=True) app.config.from_mapping( SECRET_KEY="dev", - SQLALCHEMY_DATABASE_URI="postgresql+psycopg2://postgres:postgres@db:5432/hackspace", + SQLALCHEMY_DATABASE_URI="postgresql+psycopg2://postgres:postgres@localhost:5432/hackspace", + # SQLALCHEMY_DATABASE_URI=os.getenv('DATABASE_URL'), STORAGE_LOGIN_SECRET="dev", STORAGE_APP_URL="http://example.com" ) diff --git a/quadlet/hackspace-mgmt.container b/quadlet/hackspace-mgmt.container index 4443847..0ce47d1 100644 --- a/quadlet/hackspace-mgmt.container +++ b/quadlet/hackspace-mgmt.container @@ -6,7 +6,7 @@ After=local-fs.target # May want to edit the After line to be e.g. after Postgres is available on other PC. [Container] -Image=hackspace-mgmt:latest +Image=hackspace-mgmt_app:latest # don't think we need an Exec= command Annotation="run.oci.keep_original_groups=1" UserNS=keep-id @@ -17,6 +17,7 @@ PublishPort=5000:5000 # change the first port to whatever you want it to be :). # DNS= # DNSOption= # DNSSearch= +Environment=DATABASE_URI="postgresql+psycopg2://postgres:postgres@localhost:5432/hackspace" [Install] # Start by default on boot From 400d178250952807d11cb64a5f2f4d3336adec01 Mon Sep 17 00:00:00 2001 From: Nat Hough Date: Wed, 31 Dec 2025 20:56:56 +0000 Subject: [PATCH 09/14] docker-compose back to a working state. --- docker-compose.yml | 36 +++++++++++++++++++++++++++--------- hackspace_mgmt/__init__.py | 1 + 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index d5bfbe9..a8b8ca6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,9 +4,12 @@ services: app: build: context: . + dockerfile: ./Dockerfile # dockerfile: .devcontainer/Dockerfile ports: - "5000:5000" + depends_on: + - db # volumes: # - ../..:/workspaces:cached @@ -15,25 +18,40 @@ services: # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. # network_mode: service:db - + network_mode: host # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. # (Adding the "ports" property to this file will not forward from a Codespace.) +# DB_17 is provided as a means to stand up a postgres_17 database. I would hope we'll move to postgres_18 eventually. + # db_17: + # image: postgres:17 + # restart: unless-stopped + # volumes: + # - postgres-data:/var/lib/postgresql/data + # - ./migration:/docker-entrypoint-initdb.d:ro # This mounts the hacksapce-mgmt/migration folder to the postgresql container and initialises the hackspace database with all required tables using inserted scripts. + # environment: + # POSTGRES_HOST: localhost + # POSTGRES_USER: postgres + # POSTGRES_DB: hackspace + # POSTGRES_PASSWORD: postgres # pass in a secret here. + # ports: + # - 5432:5432 + # network_mode: host + db: - image: postgres:17 + image: postgres:18 restart: unless-stopped volumes: - - postgres-data:/var/lib/postgresql/data - - ./migration:/testdata/migration:ro + - postgres-data:/var/lib/postgresql + - ./migration:/docker-entrypoint-initdb.d:ro # This mounts the hacksapce-mgmt/migration folder to the postgresql container and initialises the hackspace database with all required tables using inserted scripts. environment: + POSTGRES_HOST: localhost POSTGRES_USER: postgres - POSTGRES_DB: postgres - POSTGRES_PASSWORD: postgres + POSTGRES_DB: hackspace + POSTGRES_PASSWORD: postgres # pass in a secret here. ports: - 5432:5432 - # Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally. - # (Adding the "ports" property to this file will not forward from a Codespace.) + network_mode: host volumes: postgres-data: - migration: diff --git a/hackspace_mgmt/__init__.py b/hackspace_mgmt/__init__.py index a54bf24..7534e79 100644 --- a/hackspace_mgmt/__init__.py +++ b/hackspace_mgmt/__init__.py @@ -9,6 +9,7 @@ def create_app(test_config=None): app.config.from_mapping( SECRET_KEY="dev", SQLALCHEMY_DATABASE_URI="postgresql+psycopg2://postgres:postgres@localhost:5432/hackspace", + # note USERNAME AND PASSWORD NEED TO CHANGE HERE # SQLALCHEMY_DATABASE_URI=os.getenv('DATABASE_URL'), STORAGE_LOGIN_SECRET="dev", STORAGE_APP_URL="http://example.com" From 4df0dd9c1a21e64cd8a1c956996814d3c80f3cdf Mon Sep 17 00:00:00 2001 From: Nat Hough Date: Wed, 31 Dec 2025 21:09:07 +0000 Subject: [PATCH 10/14] Draft first postgres quadlet, untested. --- quadlet/postgres-mgmt.container | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 quadlet/postgres-mgmt.container diff --git a/quadlet/postgres-mgmt.container b/quadlet/postgres-mgmt.container new file mode 100644 index 0000000..8db1170 --- /dev/null +++ b/quadlet/postgres-mgmt.container @@ -0,0 +1,33 @@ +# documentation: https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html + +[Unit] +Description=The postgres container for sensitive data from hackspace-Mgmt +After=local-fs.target +# May want to edit the After line to be e.g. after Postgres is available on other PC. + +[Container] +Image=postgres:18 + +# Apparently needed? +Annotation="run.oci.keep_original_groups=1" +UserNS=keep-id + +PublishPort=5432:5432 # need to change external port (left side) +# HostName=name +# IP=10.0.0.1 +# IPv6=2001::1 +# DNS= +# DNSOption= +# DNSSearch= +Environment=POSTGRES_HOST=localhost +Environment=POSTGRES_USER=postgres +Environment=POSTGRES_PASSWORD=postgres +Environment=POSTGRES_DB=hackspace +Volume=/srv/USER/data/postgres:/var/lib/postgresql +Volume=/home/USER/hackspace-mgmt/migration:/docker-entrypoint-initdb.d:ro + +# NETWORK_MODE: HOST <- MAY BE NEEDED? + +[Install] +# Start by default on boot +WantedBy=multi-user.target default.target \ No newline at end of file From c7b13d210487016e83ff8add7714e83d7b9ca027 Mon Sep 17 00:00:00 2001 From: Nat Hough Date: Wed, 31 Dec 2025 21:20:24 +0000 Subject: [PATCH 11/14] first inklings of podman secret usage --- quadlet/postgres-mgmt.container | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/quadlet/postgres-mgmt.container b/quadlet/postgres-mgmt.container index 8db1170..4d572a0 100644 --- a/quadlet/postgres-mgmt.container +++ b/quadlet/postgres-mgmt.container @@ -19,10 +19,16 @@ PublishPort=5432:5432 # need to change external port (left side) # DNS= # DNSOption= # DNSSearch= + +# First try with these environment variables: Environment=POSTGRES_HOST=localhost Environment=POSTGRES_USER=postgres Environment=POSTGRES_PASSWORD=postgres Environment=POSTGRES_DB=hackspace + +# Then replace PASSWORD and try again: +# Secret=POSTGRES_PASSWORD,type=env,target=POSTGRES_PASSWORD + Volume=/srv/USER/data/postgres:/var/lib/postgresql Volume=/home/USER/hackspace-mgmt/migration:/docker-entrypoint-initdb.d:ro From e80627de8b086fed0d17007a2153a8c3d0562015 Mon Sep 17 00:00:00 2001 From: Nat Hough Date: Thu, 1 Jan 2026 18:32:27 +0000 Subject: [PATCH 12/14] update quadlet for mgmt --- quadlet/hackspace-mgmt.container | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/quadlet/hackspace-mgmt.container b/quadlet/hackspace-mgmt.container index 0ce47d1..09adf70 100644 --- a/quadlet/hackspace-mgmt.container +++ b/quadlet/hackspace-mgmt.container @@ -3,7 +3,10 @@ [Unit] Description=The hackspace-Mgmt container After=local-fs.target -# May want to edit the After line to be e.g. after Postgres is available on other PC. + +# Works if both quadlet services are on the SAME PC! +After=postgres-mgmt.container +Requires=postgres-mgmt.container [Container] Image=hackspace-mgmt_app:latest From 594451bac88f7e65067bd8257f35f223156a7f10 Mon Sep 17 00:00:00 2001 From: Nat Hough Date: Wed, 14 Jan 2026 14:29:02 +0000 Subject: [PATCH 13/14] move quadlet files to correct folder structure. --- {quadlet => .config/containers/systemd}/hackspace-mgmt.container | 0 {quadlet => .config/containers/systemd}/postgres-mgmt.container | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {quadlet => .config/containers/systemd}/hackspace-mgmt.container (100%) rename {quadlet => .config/containers/systemd}/postgres-mgmt.container (100%) diff --git a/quadlet/hackspace-mgmt.container b/.config/containers/systemd/hackspace-mgmt.container similarity index 100% rename from quadlet/hackspace-mgmt.container rename to .config/containers/systemd/hackspace-mgmt.container diff --git a/quadlet/postgres-mgmt.container b/.config/containers/systemd/postgres-mgmt.container similarity index 100% rename from quadlet/postgres-mgmt.container rename to .config/containers/systemd/postgres-mgmt.container From b6d9ab78790240c03b76966c35f44a1e5a2fef75 Mon Sep 17 00:00:00 2001 From: Nat Hough Date: Wed, 14 Jan 2026 16:21:03 +0000 Subject: [PATCH 14/14] docs uplift. --- docs/01_dev_environment.md | 2 +- docs/03_dockerfile.md | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/01_dev_environment.md b/docs/01_dev_environment.md index d8d053d..909b88c 100644 --- a/docs/01_dev_environment.md +++ b/docs/01_dev_environment.md @@ -4,7 +4,7 @@ This is a somewhat straightforward python Flask app, backed by a Postgres databa The repository has a dev container configured which you can use if you like. -Requiments: +Requirements: - Python 3.9+ - PostgreSQL 14+ - installed as part of the devcontainer if you are using it. - Some ability to run Postgres queries directly - pgAdmin is a good GUI option, while `psql` is a good CLI - both are bundled with Postgres diff --git a/docs/03_dockerfile.md b/docs/03_dockerfile.md index c1f6ac8..2f1f12f 100644 --- a/docs/03_dockerfile.md +++ b/docs/03_dockerfile.md @@ -1,15 +1,20 @@ -build with podman build -t hackspace-mgmt:latest . +# Podman +build with `podman build -t hackspace-mgmt:latest .` -run with podman run --name hs-mgmt --network host --rm localhost/hackspace-mgmt:latest +run with `podman run --name hs-mgmt --network host --rm localhost/hackspace-mgmt:latest` -access on your web browser at localhost:5000 +access on your web browser at `localhost:5000/admin` + +# Podman-compose +run `podman-compose up [--build]` +access on your web browser at `localhost:5000/admin` # Quadlet Copy the hackspace-mgmt.container file from `./quadlet/` to one of the locations mentioned below. do a systemctl daemon-reload (whether as a root or as a `--user`) do a systemctl start hackspace-mgmt.service (whether as a root or as a `--user`) `systemctl [--user] status hackspace-mgmt.service` and `podman ps -a` to determine status. - +access on your web browser at `localhost:5000/admin` ### Quadlet notes https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html/building_running_and_managing_containers/assembly_porting-containers-to-systemd-using-podman_building-running-and-managing-containers @@ -27,3 +32,4 @@ The two important settings for allowing the container to use the peer authentica Annotation="run.oci.keep_original_groups=1" UserNS=keep-id ``` +access on your web browser at `localhost:5000/admin` \ No newline at end of file