Podman for Production

Just a memo for todos and code snippets …​

Handling Images

Update Ruby

Update ruby base image
podman pull docker.io/library/ruby:3.2.7-slim

Build Image

Build
podman build -t cocard .
Inspect image
podman run --rm -it cocard /bin/bash

Tag Image

Tag image
podman tag cocard ghcr.io/swobspace/cocard:0.7.8
podman tag cocard ghcr.io/swobspace/cocard:stable
podman tag cocard ghcr.io/swobspace/cocard:latest

Push Image

Push image
export CR_PAT=YOUR_TOKEN
echo $CR_PAT | podman login ghcr.io -u swobspace --password-stdin
podman push ghcr.io/swobspace/cocard:0.7.8
podman push ghcr.io/swobspace/cocard:stable
podman push ghcr.io/swobspace/cocard:latest

Variables

env.production.example
# ~/.env.development.local.example
# Timezone, Locale
TZ=Europe/Berlin
LOCALE=en

# generate key with bin/rails secret
# SecureRandom.hex(64)
SECRET_KEY_BASE=****

# -- redis
REDIS_URL=redis://localhost:6379

# -- postgres
POSTGRES_USER=cocard
# SecureRandom.base64(32)
POSTGRES_PASSWORD=****
POSTGRES_HOST=localhost

# URL building
URL_HOST=example.com
URL_PORT=8443
URL_PROTOCOL=https

# card terminal websocket and SMC-B pin
DEFAULT_WS_AUTH_USER=admin
DEFAULT_WS_AUTH_PASS=strenggeheim
DEFAULT_SMCB_PIN=11111111
Table 1. Some Hints
Hint Description