Docker or container image for running Akaunting
- Shell 56.6%
- Dockerfile 43.4%
| Caddyfile | ||
| Containerfile | ||
| entrypoint.sh | ||
| LICENSE | ||
| php-fpm-pool.conf | ||
| README.md | ||
akaunting-container
Container image for running Akaunting (v3.1.21) in Kubernetes with php-fpm and a Caddy sidecar.
Design
- PostgreSQL only —
DB_CONNECTIONis hardcoded topgsql - 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/publicto 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:
- Init container — copies static assets to a shared emptyDir
- php-fpm container — runs the application
- 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"