Skip to content

Instantly share code, notes, and snippets.

@adamrees89
Created January 18, 2021 09:40
Show Gist options
  • Save adamrees89/90cc83f97b836311ce03c3653315e01f to your computer and use it in GitHub Desktop.
Save adamrees89/90cc83f97b836311ce03c3653315e01f to your computer and use it in GitHub Desktop.
InvoiceNinja Docker-compose
version: '3.7'
services:
server:
image: nginx
restart: always
environment:
- APP_URL=http://[MYINTERNALIP]/
volumes:
# Vhost configuration
- ./config/nginx/in-vhost.conf:/etc/nginx/conf.d/in-vhost.conf:ro
# Configure your mounted directories, make sure the folder 'public' and 'storage'
# exist, before mounting them
- public:/var/www/app/public
- storage:/var/www/app/storage
depends_on:
- app
# Run webserver nginx on port 80 or 8080 is 80 is occupied
ports:
- "80:80"
networks:
- invoiceninja
app:
image: invoiceninja/invoiceninja:5
restart: always
cap_add:
- SYS_ADMIN
environment:
- APP_URL=http://[MYINTERNALIP]/
- APP_KEY=base64:[APPKEY]
- APP_DEBUG=true
- MULTI_DB_ENABLED=false
- DB_HOST1=db
- DB_USERNAME1=ninja
- DB_PASSWORD1=ninja
- DB_DATABASE1=ninja
- PHANTOMJS_PDF_GENERATION=false
- PHANTOMJS_CLOUD_KEY=‘a-demo-key-with-low-quota-per-ip-address’
- PHANTOMJS_SECRET=secret
- SNAPPDF_EXECUTABLE_PATH=/usr/bin/chromium-browser
- SNAPPDF_SKIP_DOWNLOAD=false
volumes:
# Configure your mounted directories, make sure the folder 'public' and 'storage'
# exist, before mounting them
- public:/var/www/app/public
- storage:/var/www/app/storage
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/app/public:/var/www/app/public:rw,delegated
# - ./docker/app/storage:/var/www/app/storage:rw,delegated
depends_on:
- db
networks:
- invoiceninja
db:
image: mysql:5
restart: always
environment:
- MYSQL_ROOT_PASSWORD=[ROOT_PASS]
- MYSQL_USER=ninja
- MYSQL_PASSWORD=ninja
- MYSQL_DATABASE=ninja
volumes:
- mysql-data:/var/lib/mysql:rw
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/mysql/data:/var/lib/mysql:rw,delegated
networks:
- invoiceninja
volumes:
mysql-data:
public:
storage:
# This is needed for letting th cron run correctly
# logo:
networks:
invoiceninja:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment