D
Dokployβ€’5mo ago
Septimus

How can I host on Dokploy port 80?

I'm trying to host a page on port 80 of Dokploy my host. I've tried different ways but keep failing. Can someone show me an example?
29 Replies
DJKnaeckebrot
DJKnaeckebrotβ€’5mo ago
https://github.com/Dokploy/dokploy/blob/canary/apps/dokploy/templates/nextcloud-aio/docker-compose.yml nextcloud template is running on port 80 Take it as a sample and create a domain to the container on port 80 πŸ™‚
GitHub
dokploy/apps/dokploy/templates/nextcloud-aio/docker-compose.yml at ...
Open Source Alternative to Vercel, Netlify and Heroku. - Dokploy/dokploy
Septimus
SeptimusOPβ€’5mo ago
@DJKnaeckebrot ok thanks but how do i make sure the host port 80 maps to container port 80? because when i go to the root of my domain there is no page
Septimus
SeptimusOPβ€’5mo ago
No description
Septimus
SeptimusOPβ€’5mo ago
No description
DJKnaeckebrot
DJKnaeckebrotβ€’5mo ago
Is that domain also the same you use to access dokploy? Also did you check that your containers are running ?
Septimus
SeptimusOPβ€’5mo ago
yes! they are running
DJKnaeckebrot
DJKnaeckebrotβ€’5mo ago
Can you show me the log please? Also what application are you running?
Septimus
SeptimusOPβ€’5mo ago
docker-compose.yml:
version: '3.8'

services:
web:
image: httpd:latest
ports:
- "8080:80"
volumes:
- /home/user/www:/usr/local/apache2/htdocs/
version: '3.8'

services:
web:
image: httpd:latest
ports:
- "8080:80"
volumes:
- /home/user/www:/usr/local/apache2/htdocs/
dokploy.yml
deploy:
- name: apache_server
description: "Deploy Apache server with Docker Compose"
type: docker_compose
path: ./ # Path to your docker-compose.yml file
command: up
options:
detach: true # Runs in detached mode (optional)
deploy:
- name: apache_server
description: "Deploy Apache server with Docker Compose"
type: docker_compose
path: ./ # Path to your docker-compose.yml file
command: up
options:
detach: true # Runs in detached mode (optional)
Initializing deployment Clonning Repo github.com/zzzzzzzzzz/northflank-dashboard.git to /etc/dokploy/compose/port-80-ok-4wfqrr/code: βœ… Cloning into '/etc/dokploy/compose/port-80-ok-4wfqrr/code'... remote: Enumerating objects: 4, done. remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0) Cloned github.com/zzzzzzzz/northflank-dashboard.git: βœ… ╔══════════════════════════════════════════════════════════════════════════════╗ β•‘ β•‘ β•‘ App Name: port-80-ok-4wfqrr β•‘ β•‘ Build Compose 🐳 β•‘ β•‘ Detected: 0 mounts πŸ“‚ β•‘ β•‘ Command: docker compose -p port-80-ok-4wfqrr -f ./docker-compose.yml up -d β•‘ β•‘ --build --remove-orphans β•‘ β•‘ Source Type: docker github βœ… β•‘ β•‘ Compose Type: docker-compose βœ… β•‘ β•‘ β•‘ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• time="" level=warning msg="/etc/dokploy/compose/port-80-ok-4wfqrr/code/docker-compose.yml: the attribute version is obsolete, it will be ignored, please remove it to avoid potential confusion" Container port-80-ok-4wfqrr-web-1 Running Docker Compose Deployed: βœ…
Septimus
SeptimusOPβ€’5mo ago
No description
Septimus
SeptimusOPβ€’5mo ago
@DJKnaeckebrot
DJKnaeckebrot
DJKnaeckebrotβ€’5mo ago
there is no need to publicly open ports by using 8080:80, this will only lead to port conflics. it recommended to use a different format
version: '3.8'

services:
web:
image: httpd:latest
ports:
- 80
networks:
- dokploy-network
volumes:
- /home/user/www:/usr/local/apache2/htdocs/
version: '3.8'

services:
web:
image: httpd:latest
ports:
- 80
networks:
- dokploy-network
volumes:
- /home/user/www:/usr/local/apache2/htdocs/
https://docs.dokploy.com/docs/core/troubleshooting#docker-compose-domain-not-working
Troubleshooting | Dokploy
Solve the most common problems that occur when using Dokploy.
DJKnaeckebrot
DJKnaeckebrotβ€’5mo ago
but out of curiosity, what type of app are you hosting when ypu need an apache?
Septimus
SeptimusOPβ€’5mo ago
Sorry, i changed it to just 80 it is still the same, even after rebuild and redeploy just a single html page i don't mind how i do it, i just want to be able to host a static page
DJKnaeckebrot
DJKnaeckebrotβ€’5mo ago
I think you might can to it in a different way
Septimus
SeptimusOPβ€’5mo ago
ok i am happy for any suggestion
DJKnaeckebrot
DJKnaeckebrotβ€’5mo ago
i've not yet done it, lemme just try it out on one of my servers πŸ˜„
Septimus
SeptimusOPβ€’5mo ago
:D thanks for your help i realise most people don't want to deploy apps on port 80 on the root domain
DJKnaeckebrot
DJKnaeckebrotβ€’5mo ago
yeah usually if you wanna have multiple apps you wanna move them to different ports and add a reverse proxy in that way you dont waste a whole webserver instance for just one app
Septimus
SeptimusOPβ€’5mo ago
well you might want one app on foo.bar and then another app on app2.foo.bar not sure why that should be a problem
DJKnaeckebrot
DJKnaeckebrotβ€’5mo ago
ok got it running do you host your source code on github?
Septimus
SeptimusOPβ€’5mo ago
yes but i don't mind in this case, it could be a file on the host prefer github though what solution worked for you?
DJKnaeckebrot
DJKnaeckebrotβ€’5mo ago
it got it running on gh lemme just make some screen for you to replicate
DJKnaeckebrot
DJKnaeckebrotβ€’5mo ago
First you need to create an application and not a compose In that new application you select github as source code provider. You choose your repo and branch. I build type, set it to Static On the domain Tab create a domain and point it to Port 80 πŸ™‚ After that just deploy and it should work
No description
No description
Septimus
SeptimusOPβ€’5mo ago
wow amazing it worked! thank you so much! so to recap, static pages will work but not docker compose? im happy with this btw
DJKnaeckebrot
DJKnaeckebrotβ€’5mo ago
You prob can get this running but its a harder way than just using an application πŸ˜„ Also as an FYI, if you ever add more servers to your install and create a swarm applications will be spread over the docker swarm which is better than a compose that will only run on 1 server πŸ™‚ You're welcome πŸ™‚
Septimus
SeptimusOPβ€’5mo ago
πŸŽ‰
Septimus
SeptimusOPβ€’5mo ago
Sadly after deleting project and following these instructions again, it's not working πŸ˜΅β€πŸ’« If I add localhost to Domains page, i can successfully reach it using curl localhost
No description
Septimus
SeptimusOPβ€’5mo ago
but others are not reachable
user@northflank:~> curl localhost
<html>
Hello world
</html>

0 user@northflank:~> curl northflank.tail081a1.ts.net
curl: (7) Failed to connect to northflank.tail081a1.ts.net port 80 after 3 ms: Couldn't connect to server

7 user@northflank:~> ifconfig | grep inet | grep 192
inet 192.168.1.218 netmask 255.255.255.0 broadcast 192.168.1.255
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255

0 user@northflank:~> curl 192.168.1.218
curl: (7) Failed to connect to 192.168.1.218 port 80 after 0 ms: Couldn't connect to server
user@northflank:~> curl localhost
<html>
Hello world
</html>

0 user@northflank:~> curl northflank.tail081a1.ts.net
curl: (7) Failed to connect to northflank.tail081a1.ts.net port 80 after 3 ms: Couldn't connect to server

7 user@northflank:~> ifconfig | grep inet | grep 192
inet 192.168.1.218 netmask 255.255.255.0 broadcast 192.168.1.255
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255

0 user@northflank:~> curl 192.168.1.218
curl: (7) Failed to connect to 192.168.1.218 port 80 after 0 ms: Couldn't connect to server
However, i know dns address is not a problem because I can access on another port such as 3001
user@northflank:~> curl northflank.tail081a1.ts.net:3001
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport"...
user@northflank:~> curl northflank.tail081a1.ts.net:3001
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport"...
0 user@northflank:~> docker ps | grep 80
947b8bf7fb33 tesla-tesla-xie9wo:latest "/docker-entrypoint.…" 23 minutes ago Up 23 minutes 80/tcp tesla-tesla-xie9wo.1.63cfrj6y5g8xbbb6beh9oxuue
6d56ad210a94 traefik:v3.1.2 "/entrypoint.sh trae…" 4 hours ago Up 4 hours 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp dokploy-traefik.1.9j3et8t2x7olykw263suujiws
0 user@northflank:~> docker ps | grep 80
947b8bf7fb33 tesla-tesla-xie9wo:latest "/docker-entrypoint.…" 23 minutes ago Up 23 minutes 80/tcp tesla-tesla-xie9wo.1.63cfrj6y5g8xbbb6beh9oxuue
6d56ad210a94 traefik:v3.1.2 "/entrypoint.sh trae…" 4 hours ago Up 4 hours 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp dokploy-traefik.1.9j3et8t2x7olykw263suujiws
App with 80 is up Is there any way to debug traefik? Nevermind sorted it out i think
DJKnaeckebrot
DJKnaeckebrotβ€’5mo ago
What did you find out? I just got back

Did you find this page helpful?