Skip to content

Instantly share code, notes, and snippets.

@thomascenni
Last active November 4, 2021 13:04
Show Gist options
  • Save thomascenni/d2e68eb54484f8d9bb797e9a0c2d296d to your computer and use it in GitHub Desktop.
Save thomascenni/d2e68eb54484f8d9bb797e9a0c2d296d to your computer and use it in GitHub Desktop.
InvoiceNinja one-click app for Caprover (work in progress)
captainVersion: 4
services:
$$cap_appname-db:
image: mysql:5.7.32
restart: always
environment:
MYSQL_ROOT_PASSWORD: $$cap_db_root_password
MYSQL_DATABASE: ninja
MYSQL_USER: invoiceninja
MYSQL_PASSWORD: $$cap_db_invoiceninja_password
volumes:
- $$cap_appname-mysql-data:/var/lib/mysql
caproverExtra:
notExposeAsWebApp: "true"
$$cap_appname:
caproverExtra:
dockerfileLines:
- FROM nginx:1.19.3-alpine
- ADD https://raw.githubusercontent.com/invoiceninja/dockerfiles/master/config/nginx/in-vhost.conf /etc/nginx/conf.d/
- RUN sed -i 's/app:9000/srv-captain--$$cap_appname-app:9000/g' /etc/nginx/conf.d/in-vhost.conf
volumes:
- $$cap_appname-public:/var/www/app/public
- $$cap_appname-storage:/var/www/app/storage
$$cap_appname-app:
image: invoiceninja/$$cap_invoiceninja_version
restart: always
environment:
APP_URL: http://$$cap_appname.$$cap_root_domain
APP_KEY: base64:tDzSz912hueQSHtRd7Hmlb11IkvY7taa90AZslht5hA=
DB_TYPE: "mysql"
MULTI_DB_ENABLED: "false"
DB_HOST1: srv-captain--$$cap_appname-db
DB_USERNAME1: invoiceninja
DB_PASSWORD1: $$cap_db_invoiceninja_password
DB_DATABASE1: ninja
PHANTOMJS_PDF_GENERATION: "false"
volumes:
- $$cap_appname-public:/var/www/app/public
- $$cap_appname-storage:/var/www/app/storage
depends_on:
- $$cap_appname-db
caproverExtra:
containerHttpPort: "9000"
notExposeAsWebApp: "true"
caproverOneClickApp:
variables:
- defaultValue: invoiceninja:5.0.43
description: Check out their Docker page for the valid tags https://hub.docker.com/r/invoiceninja/invoiceninja/tags
id: $$cap_invoiceninja_version
label: Invoiceninja version
validRegex: /^([^\s^\/])+$/
- description: Root password that will be created on MySQL
id: $$cap_db_root_password
label: MySQL root password
validRegex: /^(?=.*\d).{10,}$/
- description: Password for database user named 'invoiceninja'
id: $$cap_db_invoiceninja_password
label: MySQL Invoiceninja password
validRegex: /^(?=.*\d).{10,}$/
instructions:
end: >
InvoiceNinja is deployed and available as $$cap_appname.
IMPORTANT: It will take up to 2 minutes for Invoiceninja to be ready. Before that, you might see 502 error page.
start: https://www.invoiceninja.org/
displayName: Invoiceninja
isOfficial: false
description: The leading free open-source online invoicing app for freelancers & businesses. Invoice, accept payments, track expenses, create proposals and time-tasks.
documentation: Taken from https://www.invoiceninja.org/.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment