Hey all,
i am new to this, so pls be nice ![]()
I am trying to set up InvoiceNinja via Docker on my VPS, running Ubuntu x64.
This is my compose i am deploying via Portainer:
`
x-logging: &default-logging
driver: json-file
options:
max-size: "10m"
max-file: "3"
services:
app:
image: invoiceninja/invoiceninja:latest
restart: unless-stopped
env_file:
- ./stack.env
volumes:
- ./stack.env:/var/www/html/.env
- InvoiceNinja-app_public:/var/www/html/public
- InvoiceNinja-app_storage:/var/www/html/storage
networks:
- app-network
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
logging: *default-logging
nginx:
image: nginx:alpine
restart: unless-stopped
ports:
- "8012:80" # matches APP_URL=http://localhost:8012
volumes:
- InvoiceNinja-nginx:/etc/nginx/conf.d:ro
- InvoiceNinja-app_public:/var/www/html/public:ro
- InvoiceNinja-app_storage:/var/www/html/storage:ro
networks:
- app-network
depends_on:
- app
logging: *default-logging
mysql:
image: mysql:8.0
restart: unless-stopped
env_file:
- ./stack.env
volumes:
- InvoiceNinja-mysql_data:/var/lib/mysql
networks:
- app-network
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -u$${MYSQL_USER} -p$${MYSQL_PASSWORD} || exit 1"]
interval: 10s
timeout: 5s
retries: 12
start_period: 60s
logging: *default-logging
redis:
image: redis:alpine
restart: unless-stopped
# Your .env has REDIS_PASSWORD=null => start Redis without auth
command: ["redis-server", "--appendonly", "yes"]
volumes:
- InvoiceNinja-redis_data:/data
networks:
- app-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 10
start_period: 20s
logging: *default-logging
networks:
app-network:
driver: bridge
volumes:
InvoiceNinja-app_public:
external: true
InvoiceNinja-app_storage:
external: true
InvoiceNinja-mysql_data:
external: true
InvoiceNinja-redis_data:
external: true
InvoiceNinja-nginx:
external: true
In my .env file i have set the APP_URL and REQUIRE_HTTPS to true.
My problem here is how the nginx works inside the docker container itself. I am confused If I myself need to PROVIDE a nginx conf FOR the invoice ninja?! This is the first i am seeing that i am forced to give a configured nginx for the docker containers itself. In most cases, u either have it already built in the app itself, or like here, its running as seperate container in the compose BUT its already preconfigured. Here i am being forced to configure it on my own, as seen at
volumes:
- InvoiceNinja-nginx:/etc/nginx/conf.d:ro
My problem here is that the information i am finding are outdated partially. There is this https://www.youtube.com/watch?v=xo6a3KtLC2g which is over 3 years old and where the docker compose is not uptodate with the one here: GitHub - invoiceninja/dockerfiles: Docker files for Invoice Ninja
So can someone please tell me or provide me a nginx.conf FOR THE DOCKER HOST itself.
And the second question is my own nginx reverse proxy, which should not be a problem for me to configure once i know how the nginx itself runs in the docker host.
Thank you
Furkan