Docker or container image for running Akaunting
  • Shell 56.6%
  • Dockerfile 43.4%
Find a file
2026-03-12 09:25:29 -04:00
Caddyfile Add container image for Akaunting 3.1.21 with php-fpm and Caddy sidecar 2026-03-08 21:33:37 -04:00
Containerfile Correcting dependencies. 2026-03-09 09:46:37 -04:00
entrypoint.sh Minor corrections. 2026-03-12 09:25:29 -04:00
LICENSE Initial commit 2026-03-09 01:11:26 +00:00
php-fpm-pool.conf Add container image for Akaunting 3.1.21 with php-fpm and Caddy sidecar 2026-03-08 21:33:37 -04:00
README.md Add container image for Akaunting 3.1.21 with php-fpm and Caddy sidecar 2026-03-08 21:33:37 -04:00

akaunting-container

Container image for running Akaunting (v3.1.21) in Kubernetes with php-fpm and a Caddy sidecar.

Design

  • PostgreSQL onlyDB_CONNECTION is hardcoded to pgsql
  • php-fpm + Caddy sidecar — php-fpm serves PHP, Caddy serves static assets and proxies
  • Single image — Caddy gets static assets via an init container copying /var/www/html/public to a shared emptyDir
  • stderr logging — works with Kubernetes log collection out of the box
  • ENTRYPOINT/CMD split — run artisan commands with the same image: podman run akaunting php artisan ...

Build

podman build -t akaunting:3.1.21 .

To build a different version:

podman build --build-arg AKAUNTING_VERSION=3.1.22 -t akaunting:3.1.22 .

Environment Variables

Variable Required Default Description
APP_KEY Yes (generated on first run) Laravel app key. Persist this!
APP_URL Yes http://localhost Public URL of the application
APP_INSTALLED No false Set to true after initial install
DB_HOST Yes postgres PostgreSQL hostname
DB_PORT No 5432 PostgreSQL port
DB_DATABASE No akaunting Database name
DB_USERNAME No akaunting Database user
DB_PASSWORD Yes (empty) Database password
ADMIN_EMAIL On install admin@example.com Admin account email
ADMIN_PASSWORD On install changeme Admin account password
COMPANY_NAME On install My Company Default company name
COMPANY_EMAIL On install $ADMIN_EMAIL Default company email
LOCALE No en-US Application locale
CACHE_DRIVER No file Laravel cache driver
QUEUE_CONNECTION No sync Laravel queue connection
SESSION_DRIVER No file Laravel session driver
LOG_LEVEL No warning Log level
MAIL_MAILER No smtp Mail driver
MAIL_HOST No (empty) SMTP host
MAIL_PORT No 587 SMTP port
MAIL_USERNAME No (empty) SMTP username
MAIL_PASSWORD No (empty) SMTP password
MAIL_ENCRYPTION No tls SMTP encryption
MAIL_FROM_ADDRESS No (empty) Sender address
MAIL_FROM_NAME No Akaunting Sender name

Kubernetes Deployment

The recommended pattern uses three containers in a single pod:

  1. Init container — copies static assets to a shared emptyDir
  2. php-fpm container — runs the application
  3. Caddy sidecar — serves static files and proxies PHP requests
apiVersion: apps/v1
kind: Deployment
metadata:
  name: akaunting
spec:
  replicas: 1
  selector:
    matchLabels:
      app: akaunting
  template:
    metadata:
      labels:
        app: akaunting
    spec:
      initContainers:
        - name: copy-public
          image: akaunting:3.1.21
          command: ["cp", "-a", "/var/www/html/public/.", "/srv/public/"]
          volumeMounts:
            - name: public-assets
              mountPath: /srv/public

      containers:
        - name: php-fpm
          image: akaunting:3.1.21
          ports:
            - containerPort: 9000
          envFrom:
            - secretRef:
                name: akaunting-env
          volumeMounts:
            - name: storage
              mountPath: /var/www/html/storage

        - name: caddy
          image: caddy:2
          ports:
            - containerPort: 8080
          volumeMounts:
            - name: public-assets
              mountPath: /srv/public
              readOnly: true
            - name: caddyfile
              mountPath: /etc/caddy/Caddyfile
              subPath: Caddyfile

      volumes:
        - name: public-assets
          emptyDir: {}
        - name: storage
          persistentVolumeClaim:
            claimName: akaunting-storage
        - name: caddyfile
          configMap:
            name: akaunting-caddyfile

Create the Caddyfile ConfigMap:

kubectl create configmap akaunting-caddyfile --from-file=Caddyfile

Create the secret with required environment variables:

kubectl create secret generic akaunting-env \
  --from-literal=APP_KEY=base64:... \
  --from-literal=APP_URL=https://akaunting.example.com \
  --from-literal=DB_HOST=postgres \
  --from-literal=DB_PASSWORD=secretpassword \
  --from-literal=ADMIN_EMAIL=admin@example.com \
  --from-literal=ADMIN_PASSWORD=changeme \
  --from-literal=COMPANY_NAME="My Company"