155 lines
3.8 KiB
YAML
155 lines
3.8 KiB
YAML
version: '2'
|
|
services:
|
|
app:
|
|
image: invoiceninja/invoiceninja:latest
|
|
dns:
|
|
- 1.1.1.1
|
|
- 1.0.0.1
|
|
environment:
|
|
TZ: Africa/Monrovia
|
|
APP_ENV: production
|
|
APP_DEBUG: false
|
|
APP_URL: https://${TRAEFIK_HOST}
|
|
APP_CIPHER: AES-256-CBC
|
|
APP_KEY: ${APP_KEY}
|
|
DB_STRICT: false
|
|
DB_HOST: mysql
|
|
DB_DATABASE: ninja_db
|
|
DB_USERNAME: ninja
|
|
DB_PASSWORD: ${DB_USER_PASS}
|
|
{{- if (.Values.MOBILE_APP_SECRET)}}
|
|
API_SECRET: ${MOBILE_APP_SECRET}
|
|
{{- end}}
|
|
{{- if (.Values.GMAPS_KEY)}}
|
|
GOOGLE_MAPS_API_KEY: ${GMAPS_KEY}
|
|
{{- end}}
|
|
labels:
|
|
io.rancher.container.pull_image: always
|
|
{{- if (.Values.HOST_LABEL)}}
|
|
io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
|
|
{{- end}}
|
|
io.rancher.sidekicks: cron, web
|
|
links:
|
|
- mysql
|
|
restart: on-failure
|
|
volumes:
|
|
- Logo:/var/www/app/public/logo
|
|
- Storage:/var/www/app/storage
|
|
cron:
|
|
image: invoiceninja/invoiceninja:latest
|
|
dns:
|
|
- 1.1.1.1
|
|
- 1.0.0.1
|
|
entrypoint: |
|
|
bash -c 'bash -s <<EOF
|
|
trap "break;exit" SIGHUP SIGINT SIGTERM
|
|
sleep 300s
|
|
while /bin/true; do
|
|
./artisan ninja:send-invoices
|
|
./artisan ninja:send-reminders
|
|
sleep 1h
|
|
done
|
|
EOF'
|
|
environment:
|
|
TZ: Africa/Monrovia
|
|
APP_ENV: production
|
|
APP_DEBUG: false
|
|
APP_URL: https://${TRAEFIK_HOST}
|
|
APP_CIPHER: AES-256-CBC
|
|
APP_KEY: ${APP_KEY}
|
|
DB_STRICT: false
|
|
DB_HOST: mysql
|
|
DB_DATABASE: ninja_db
|
|
DB_USERNAME: ninja
|
|
DB_PASSWORD: ${DB_USER_PASS}
|
|
{{- if .Values.MOBILE_APP_SECRET}}
|
|
API_SECRET: ${MOBILE_APP_SECRET}
|
|
{{- end}}
|
|
{{- if .Values.GMAPS_KEY}}
|
|
GOOGLE_MAPS_API_KEY: ${GMAPS_KEY}
|
|
{{- end}}
|
|
labels:
|
|
io.rancher.container.pull_image: always
|
|
{{- if .Values.HOST_LABEL}}
|
|
io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
|
|
{{- end}}
|
|
links:
|
|
- mysql
|
|
restart: on-failure
|
|
volumes_from:
|
|
- app
|
|
mysql:
|
|
image: mysql:5
|
|
dns:
|
|
- 1.1.1.1
|
|
- 1.0.0.1
|
|
environment:
|
|
TZ: Africa/Monrovia
|
|
MYSQL_DATABASE: ninja_db
|
|
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASS}
|
|
MYSQL_USER: ninja
|
|
MYSQL_PASSWORD: ${DB_USER_PASS}
|
|
labels:
|
|
io.rancher.container.pull_image: always
|
|
{{- if .Values.HOST_LABEL}}
|
|
io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
|
|
{{- end}}
|
|
restart: on-failure
|
|
volumes:
|
|
- Database:/var/lib/mysql
|
|
web:
|
|
image: nginx
|
|
dns:
|
|
- 1.1.1.1
|
|
- 1.0.0.1
|
|
environment:
|
|
TZ: Africa/Monrovia
|
|
labels:
|
|
io.rancher.container.pull_image: always
|
|
{{- if .Values.HOST_LABEL}}
|
|
io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
|
|
{{- end}}
|
|
{{- if .Values.TRAEFIK_HOST}}
|
|
traefik.enable: true
|
|
traefik.frontend.rule: Host:${TRAEFIK_HOST}
|
|
traefik.port: "80"
|
|
traefik.frontend.entryPoints: https
|
|
traefik.frontend.passHostHeader: true
|
|
{{- else}}
|
|
traefik.enable: false
|
|
{{- end}}
|
|
links:
|
|
- app
|
|
networks:
|
|
- public-proxy
|
|
ports:
|
|
- "${WEB_PORT}:80"
|
|
restart: on-failure
|
|
volumes:
|
|
- /RancherConfig/${DATA_DIR}/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
volumes_from:
|
|
- app
|
|
|
|
networks:
|
|
public-proxy:
|
|
external: true
|
|
|
|
volumes:
|
|
Database:
|
|
driver: rancher-nfs
|
|
driver_opts:
|
|
host: 10.0.10.21
|
|
export: /RancherCattleData/${DATA_DIR}/Database
|
|
onRemove: retain
|
|
Logo:
|
|
driver: rancher-nfs
|
|
driver_opts:
|
|
host: 10.0.10.21
|
|
export: /RancherCattleData/${DATA_DIR}/Logo
|
|
onRemove: retain
|
|
Storage:
|
|
driver: rancher-nfs
|
|
driver_opts:
|
|
host: 10.0.10.21
|
|
export: /RancherCattleData/${DATA_DIR}/Storage
|
|
onRemove: retain |