Cannot access docker compose app
Here is the compose
networks:
dokploy-network:
external: true
volumes:
token:
driver: local
services:
app:
image : ghcr.io/imagename:latest
ports:
- 3001
environment:
NODE_ENV: "production"
PORT: 3001
restart: always # Ensure the app automatically restarts if it crashes
deploy:
replicas: 3
resources:
limits:
cpus: "1.0" # Limit to 1 CPU core
memory: "512M" # Limit memory usage to 512MB
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3001"]
interval: 30s
timeout: 10s
retries: 3
volumes:
- token:/app/token
networks:
- dokploy-network
command: ["bun", "run", "start"]
I cannot acess the app after adding a domain, i have restarted the app and traefik multiple times.
i cannot acess the container from the host container either
ping containerip :
PING 10.0.1.95 (10.0.1.95) 56(84) bytes of data.
^C
--- 10.0.1.95 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4072ms12 Replies
how did you added the domain?
from the dashboard
i tried adding the labels provided here
https://docs.dokploy.com/en/docs/core/docker-compose/example
but that didnt work either.
and i noticed traefik had already add them when i press preview compose btn
Example
Learn how to use Docker Compose with Dokploy
I am also getting this eror in traefik log
ERR error="service "dokploy-traefik" error: port is missing" container=dokploy-traefik-u2kebg7lyp30m4r43syjutxdn providerName=swarm
but i read on here that its can be ignored?
no worries about that issue
wait, are you using docker stack?
No i am using docker compose.
can you please format the code? so i can copy
Looks like docker stack configuration. I did some tester recently...
You should add the domain name to the "Domains" tab in Dokploy, then Copy the automatically generated Label (see General > Preview Compose)
Add this Label configuration to the "deloy" configuration to make it work in a docker swarm
You can then delete the configuration in the Domains tab if you want because it doesn't work in this environment...
Ooh i see, i Will try that once i get home.
Thank you
The app is not deployed in docker swarm tho?
running docker service ls list other apps including dokploy but not this one difference being this app is using compose.
And adding the labels did not fix the issue. the app is still inaccessible.
I got it working by manualy createing a traefik config file.
it seems traefik is unable to detect docker containers?
If you manually create traefik and it works then your service configuration is wrong, take a look at my configuration

Oh i think the last label was mising in my setup.. will check thanks