127 lines
5.6 KiB
YAML
127 lines
5.6 KiB
YAML
captainVersion: 4
|
|
services:
|
|
$$cap_appname-php:
|
|
restart: always
|
|
networks: invoiceninja
|
|
volumes:
|
|
- $$cap_appname-data:/var/www/app
|
|
depends_on:
|
|
- $$cap_appname-db
|
|
environment:
|
|
APP_NAME: $$cap_appname
|
|
APP_URL: $$cap_appname.$$cap_root_domain
|
|
APP_KEY: $$cap_app_key
|
|
APP_DEBUG: $$cap_app_debug
|
|
MULTI_DB_ENABLED: 'false'
|
|
DB_CONNECTION: mysql
|
|
DB_HOST1: srv-captain--$$cap_appname-db
|
|
DB_PORT1: '3306'
|
|
DB_USERNAME1: $$cap_db_user
|
|
DB_PASSWORD1: $$cap_db_pass
|
|
DB_DATABASE1: $$cap_db_name
|
|
IS_DOCKER: 'true'
|
|
PHANTOMJS_PDF_GENERATION: $$cap_phantomjs_cloud_enable
|
|
PHANTOMJS_CLOUD_KEY: $$cap_phantomjs_cloud_key
|
|
BAK_PUBLIC_PATH: '/var/www/app/docker-backup-public'
|
|
NINJA_PROD: 'true'
|
|
ENV_LIST: 'NINJA_PROD,APP_NAME,APP_URL,APP_KEY,APP_DEBUG,MULTI_DB_ENABLED,DB_CONNECTION,DB_HOST1,DB_PORT1,DB_USERNAME1,DB_PASSWORD1,DB_DATABASE1,IS_DOCKER,PHANTOMJS_PDF_GENERATION,PHANTOMJS_CLOUD_KEY'
|
|
caproverExtra:
|
|
notExposeAsWebApp: 'true'
|
|
dockerfileLines:
|
|
- FROM invoiceninja/invoiceninja:$$cap_app_tag
|
|
- RUN curl -o create-env-file-from-sys-env.sh https://gist.githubusercontent.com/olragon/e2f3ececd70b8c513ce6f768b47b6e5f/raw/0ce9188a0cbf1a9e6a7be4128419282b30492f49/create-env-file-from-sys-env.sh
|
|
- RUN chmod +x create-env-file-from-sys-env.sh
|
|
- ENTRYPOINT ["docker-entrypoint"]
|
|
- CMD /var/www/app/create-env-file-from-sys-env.sh && laravel-init.sh && php artisan db:seed --force && php artisan ninja:create-account --email=$$cap_user_email --password=$$cap_user_password&& supervisord
|
|
|
|
$$cap_appname:
|
|
restart: always
|
|
networks: invoiceninja
|
|
volumes:
|
|
- $$cap_appname-data:/var/www/app
|
|
depends_on:
|
|
- $$cap_appname-php
|
|
caproverExtra:
|
|
dockerfileLines:
|
|
- FROM nginx:$$cap_nginx_tag
|
|
- RUN curl -o /etc/nginx/conf.d/in-vhost.conf https://raw.githubusercontent.com/invoiceninja/dockerfiles/$$cap_app_tag/config/nginx/in-vhost.conf
|
|
- RUN sed -i "s/app:9000/srv-captain--$$cap_appname-php:9000/g" /etc/nginx/conf.d/in-vhost.conf
|
|
- ENTRYPOINT ["/docker-entrypoint.sh"]
|
|
- EXPOSE 80
|
|
- CMD mkdir -p /var/www/app/docker-backup-public && nginx -g 'daemon off;'
|
|
|
|
$$cap_appname-db:
|
|
image: mariadb:$$cap_mariadb_tag
|
|
networks: invoiceninja
|
|
restart: always
|
|
volumes:
|
|
- $$cap_appname-db-data:/var/lib/mysql
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: $$cap_db_root_pass
|
|
MYSQL_USER: $$cap_db_user
|
|
MYSQL_PASSWORD: $$cap_db_pass
|
|
MYSQL_DATABASE: $$cap_db_name
|
|
caproverExtra:
|
|
notExposeAsWebApp: 'true'
|
|
|
|
caproverOneClickApp:
|
|
variables:
|
|
- id: $$cap_app_tag
|
|
label: Invoice Ninja Tag
|
|
defaultValue: '5.1.53'
|
|
description: 'Check out their docker page for the valid tags https://hub.docker.com/r/invoiceninja/invoiceninja/tags'
|
|
- id: $$cap_user_email
|
|
label: User Email
|
|
defaultValue: user@example.com
|
|
- id: $$cap_user_password
|
|
label: User Password (write this down as you won't be able to see it after deployment)
|
|
defaultValue: $$cap_gen_random_hex(8)
|
|
- id: $$cap_app_key
|
|
label: App Key
|
|
defaultValue: $$cap_gen_random_hex(32)
|
|
- id: $$cap_app_debug
|
|
label: App Debug
|
|
defaultValue: 'false'
|
|
- id: $$cap_phantomjs_cloud_enable
|
|
label: Enable PhantomJS Cloud to generate PDF
|
|
defaultValue: 'false'
|
|
description: By default Invoice Ninja using local Chromimum to generate PDF
|
|
- id: $$cap_phantomjs_cloud_key
|
|
label: PhantomJS Cloud Key
|
|
defaultValue: 'a-demo-key-with-low-quota-per-ip-address'
|
|
description: 'For some reason, if you cannot run Chromium, enable PhantomJS Cloud and grab your PhantomJS Cloud key at https://phantomjscloud.com/'
|
|
- id: $$cap_nginx_tag
|
|
label: Nginx Tag
|
|
defaultValue: '1.20.0-alpine'
|
|
description: 'Check out their docker page for the valid tags https://hub.docker.com/_/nginx?tab=tags'
|
|
- id: $$cap_mariadb_tag
|
|
label: MariaDB Version
|
|
defaultValue: 10.4
|
|
description: 'Check out their docker page for the valid tags https://hub.docker.com/_/mariadb?tab=tags'
|
|
- id: $$cap_db_root_pass
|
|
label: MariaDB Root Password
|
|
defaultValue: $$cap_gen_random_hex(32)
|
|
- id: $$cap_db_user
|
|
label: MariaDB Database User
|
|
defaultValue: 'ninja'
|
|
- id: $$cap_db_name
|
|
label: MariaDB Database Name
|
|
defaultValue: 'ninja'
|
|
- id: $$cap_db_pass
|
|
label: MariaDB Database Password
|
|
defaultValue: $$cap_gen_random_hex(32)
|
|
instructions:
|
|
start: >-
|
|
Invoice Clients, Track Work-Time, Get Paid Online.
|
|
For more info visit https://www.invoiceninja.com/
|
|
end: |-
|
|
InvoiceNinja has been successfully deployed!
|
|
App is available as http://$$cap_appname.$$cap_root_domain
|
|
displayName: InvoiceNinja
|
|
isOfficial: false
|
|
description: >-
|
|
Invoice Ninja was built to serve freelancers and business owners with a complete suite of invoicing & payment tools to advance your business.
|
|
documentation: >-
|
|
This docker-compose is taken from
|
|
https://github.com/invoiceninja/dockerfiles
|