Skip to content

Instantly share code, notes, and snippets.

@russelldavies
Created October 8, 2024 18:33
Show Gist options
  • Save russelldavies/e7b925ba254e8ebdcf31e54632e0cd79 to your computer and use it in GitHub Desktop.
Save russelldavies/e7b925ba254e8ebdcf31e54632e0cd79 to your computer and use it in GitHub Desktop.
Invoice Ninja docker
{
frankenphp
}
{$APP_URL} {
root /srv/public
encode zstd br gzip
php_server
}
services:
db:
image: mariadb
restart: unless-stopped
env_file: env
volumes:
- ./db:/var/lib/mysql
# - ./db_restore:/docker-entrypoint-initdb.d
logging:
driver: journald
server:
build: .
restart: unless-stopped
cap_add:
- NET_ADMIN
ports:
- "80:80"
- "443:443"
- "443:443/udp"
env_file: env
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- ./app:/srv
logging:
driver: journald
depends_on:
- db
volumes:
caddy_data:
networks:
default:
enable_ipv6: true
FROM dunglas/frankenphp
RUN install-php-extensions \
pdo_mysql \
bcmath \
gmp \
gd \
zip \
soap \
intl \
iconv \
Imagick/imagick@master \
opcache
RUN apt update && apt install -y default-mysql-client && rm -rf /var/lib/apt/lists/*
# Invoice Ninja
APP_NAME="Company Name"
APP_ENV=production
APP_KEY=base64:<generate base64 encoded secret>
APP_DEBUG="false"
APP_URL="https://invoicing.example.com"
IS_DOCKER=true
PDF_GENERATOR=hosted_ninja
DB_HOST="db"
DB_PORT="3306"
DB_DATABASE="ninja"
DB_USERNAME="ninja"
DB_PASSWORD="ninja"
MAIL_MAILER="smtp"
MAIL_HOST="host"
MAIL_PORT="587"
MAIL_USERNAME=username
MAIL_PASSWORD=password
MAIL_ENCRYPTION="tls"
MAIL_FROM_ADDRESS='[email protected]'
MAIL_FROM_NAME='Company Name'
# MySQL
MYSQL_ROOT_PASSWORD=mariadb
MYSQL_USER=ninja
MYSQL_PASSWORD=ninja
MYSQL_DATABASE=ninja
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment