Hey there,
I’ve been testing different accounting software for the last weeks, and decided to go with IN for the better features (Project/Expenses/Tasks).
I’ve followed the instructions to install the Docker container with Nginx as web server on my local server. Ideally, I’d like it to be only a local service, but I’m facing issues when generating the PDF from an invoice, as other reported. The process just gets stuck as shown in the image.
Now I’ve tried to set up the Docker to be exposed to the internet so I can use PhantomJS
Cloud to generate the PDF, but I’m struggling with the config. All my services use Nginx Proxy Manager (NPM) to be exposed and handle the certificates and Cloudflare to proxy my public IP. In NPM I expose the local server IP with the port and it handles the proxy, but this does not work. Hope you can guide me. Here are my docker-compose.yml
and my nginx.conf
.
services:
server:
image: nginx
restart: always
environment:
- APP_URL=http://fac.example.com
volumes:
# Vhost configuration
# - ./config/caddy/Caddyfile:/etc/caddy/Caddyfile
- ./config/nginx/in-vhost.conf:/etc/nginx/conf.d/in-vhost.conf:ro
- /srv/dev-disk-by-label-D1/data/appdata/invoiceninja/public:/var/www/app/public:rw,delegated
- /srv/dev-disk-by-label-D1/data/appdata/invoiceninja/storage:/var/www/app/storage:rw,delegated
depends_on:
- app
ports:
- "8888:80"
networks:
- invoiceninja
app:
image: invoiceninja/invoiceninja:5
restart: always
cap_add:
- SYS_ADMIN
environment:
- APP_URL=http://fac.example.com
- APP_KEY=base64:dp/cye89BtvaLyC+l6yFOE6lZ1YgwQTAMGVDniOtz6c=
- MULTI_DB_ENABLED=false
- DB_HOST1=db
- DB_USERNAME1=ninja
- DB_PASSWORD1=pass
- DB_DATABASE1=ninja
- PHANTOMJS_PDF_GENERATION=true
- PHANTOMJS_SECRET='your-secret-here'
volumes:
- /srv/dev-disk-by-label-D1/data/appdata/invoiceninja/public:/var/www/app/public:rw,delegated
- /srv/dev-disk-by-label-D1/data/appdata/invoiceninja/storage:/var/www/app/storage:rw,delegated
depends_on:
- db
networks:
- invoiceninja
db:
image: mysql:5
restart: always
environment:
- MYSQL_ROOT_PASSWORD=pass
- MYSQL_USER=ninja
- MYSQL_PASSWORD=pass
- MYSQL_DATABASE=ninja
volumes:
- /srv/dev-disk-by-label-D1/data/appdata/invoiceninja/mysql-data:/var/lib/mysql:rw
networks:
- invoiceninja
volumes:
mysql-data:
public:
storage:
networks:
invoiceninja:
server {
listen 80 default_server;
server_name _ in.localhost;
root /var/www/app/public/;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}
}
I’m sure my Nginx.conf is wrong and the issue should be related with it. My main questions are.
- In the
APP_URL
in thedocker-compose.yml
should I use the final wed address withhttp
orhttps
? - The
server_name
in theNginx.conf
should point also to the web address or to the local IP of the server? - Am I missing something else?
Thank you for your time.