Hi. I have used the docker-compose to up the container, but i have some situations.
1 - I have websites on the VPS that use ports 80 and 443
2 - When up with traeffik, show that can’t use ports 80 and 443
3 - I tried up without traeffic and the container does’t have internet connection, i cant’t ping for google for example.
4 - I tried with docker run, same issue, the container dont’t have internet connection.
5 - I have created the A record on DNS but that point to my website.
6 - I just have connection on container when i use the host network on docker-compose, but i cant’t use the URL just the IP and without SSL
My docker-compose
version: “3”
services:
n8n:
image: n8nio/n8n
restart: always
ports:
- ‘127.0.0.1:5678:5678’
environment:
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER
- N8N_BASIC_AUTH_PASSWORD
- N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
- N8N_PORT=5678
- N8N_PROTOCOL=https
- NODE_ENV=production
- WEBHOOK_URL=https://${DOMAIN_NAME}${N8N_PATH}
- GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
volumes:
- ${DATA_FOLDER}/.n8n:/home/node/.n8n
- ${DATA_FOLDER}/n8n-local-files:/files
My .env
Folder where data should be saved
DATA_FOLDER=/root/n8n/
The top level domain to serve from
DOMAIN_NAME=h3code.com.br
The subdomain to serve from
SUBDOMAIN=myn8n
DOMAIN_NAME and SUBDOMAIN combined decide where n8n will be reachable from
above example would result in: https://n8n.example.com
The user name to use for authentication - IMPORTANT ALWAYS CHANGE!
N8N_BASIC_AUTH_USER=user
The password to use for authentication - IMPORTANT ALWAYS CHANGE!
N8N_BASIC_AUTH_PASSWORD=pass
Optional timezone to set which gets used by Cron-Node by default
If not set New York time will be used
GENERIC_TIMEZONE=America_SaoPaulo
The email address to use for the SSL certificate creation
My docker run
docker run -d --restart always --name myn8n -p 127.0.0.1:5678:443 -e N8N_HOST=“myn8n.h3code.com.br” -e N8N_PORT=443 -e N8N_PROTOCOL=“https” -e WEBHOOK_TUNNEL_URL=“https://myn8n.h3code.com.br/” -e EXECUTIONS_DATA_PRUNE=true -v /home/root/n8n-local-files:/files -v ~/.n8n:/home/node/.n8n n8nio/n8n