-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker: Listen on all interfaces #83
Comments
It is working if I modify the startServer({
dir,
isDev: false,
config: nextConfig,
hostname: '0.0.0.0',
port: currentPort,
allowRetry: false,
keepAliveTimeout,
}).catch((err) => {
console.error(err);
process.exit(1);
}); While running in a container, we do not want the hostname set on this line and just want the ANY address. I don't know if there is a use-case if running outside of a container?
|
It's happening the same to me. I am not able to run it but no errors are shown in the logs. The browser returns me "ERR_CONNECTION_REFUSED" and no logs in the console, so I have no idea how to continue. |
@dperezq YOU can't, unless you rewrite the server.js to listen on all interfaces and mount that in to override the one that is included. |
I'm encountering the same problem. |
This is a section from my Docker Compose: power-tools:
container_name: immich_power_tools
environment:
DB_DATABASE_NAME: immich
DB_HOST: database
DB_PASSWORD: <REDACTED>
DB_PORT: 5432
DB_USERNAME: postgres
EXTERNAL_IMMICH_URL: <REDACTED>
GEMINI_API_KEY: <REDACTED>
IMMICH_API_KEY: <REDACTED>
IMMICH_URL: http://immich-server:2283
TZ: America/Chicago
image: ghcr.io/varun-raj/immich-power-tools:latest
labels:
com.centurylinklabs.watchtower.enable: 'true'
networks:
- ix-traefik_backend
- stack
ports:
- host_ip: 100.100.1.5
name: web-ui
protocol: tcp
published: 8007
target: 3000
restart: unless-stopped
tmpfs:
- /tmp
volumes:
- source: /mnt/apps/config/immich_power_tools_server.js
target: /app/server.js
type: bind You'll see how I am mounting the modified server.js from the host FS to the container. |
You can listen on all interfaces by setting the HOSTNAME environment variable in the container: environment:
HOSTNAME: '0.0.0.0' |
I run all of my containers behind a reverse proxy on the host, so there is no port mapped outside of the container network.
As such, I have a
proxy
network and animmich
network.This container picks the
immich
network to listen on port3000
instead of all networks and, as such, my reverse proxy cannot access it.Inside the container:
docker logs -f immich_power_tools ▲ Next.js 14.2.5 - Local: http://d91ff275f18f:3000 - Network: http://172.16.15.4:3000 ✓ Starting... ✓ Ready in 384ms
The text was updated successfully, but these errors were encountered: