Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions apps/website/public/install-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
version: '3.9'

networks:
dokploy-network:
driver: overlay
attachable: true

volumes:
dokploy-postgres-database:
redis-data-volume:
dokploy-docker-config:

services:
postgres:
image: postgres:16
environment:
POSTGRES_USER: dokploy
POSTGRES_DB: dokploy
POSTGRES_PASSWORD: amukds4wi9001583845717ad2
networks:
- dokploy-network
deploy:
placement:
constraints:
- node.role == manager
volumes:
- dokploy-postgres-database:/var/lib/postgresql/data

redis:
image: redis:7
networks:
- dokploy-network
deploy:
placement:
constraints:
- node.role == manager
volumes:
- redis-data-volume:/data

interface:
image: dokploy/dokploy:latest
environment:
ADVERTISE_ADDR: ${ADVERTISE_ADDR}
networks:
- dokploy-network
deploy:
replicas: 1
placement:
constraints:
- node.role == manager
update_config:
parallelism: 1
order: stop-first
ports:
- "3000:3000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /etc/dokploy:/etc/dokploy
- dokploy-docker-config:/root/.docker

traefik:
image: traefik:v3.1.2
networks:
- dokploy-network
restart: always
ports:
- "80:80"
- "443:443/tcp"
- "443:443/udp"
volumes:
- /etc/dokploy/traefik/traefik.yml:/etc/traefik/traefik.yml
- /etc/dokploy/traefik/dynamic:/etc/dokploy/traefik/dynamic
- /var/run/docker.sock:/var/run/docker.sock
73 changes: 11 additions & 62 deletions apps/website/public/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ install_dokploy() {

docker swarm init --advertise-addr $advertise_addr

if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
echo "Error: Failed to initialize Docker Swarm" >&2
exit 1
fi
Expand All @@ -116,65 +116,11 @@ install_dokploy() {

chmod 777 /etc/dokploy

docker service create \
--name dokploy-postgres \
--constraint 'node.role==manager' \
--network dokploy-network \
--env POSTGRES_USER=dokploy \
--env POSTGRES_DB=dokploy \
--env POSTGRES_PASSWORD=amukds4wi9001583845717ad2 \
--mount type=volume,source=dokploy-postgres-database,target=/var/lib/postgresql/data \
postgres:16

docker service create \
--name dokploy-redis \
--constraint 'node.role==manager' \
--network dokploy-network \
--mount type=volume,source=redis-data-volume,target=/data \
redis:7

# Installation
docker service create \
--name dokploy \
--replicas 1 \
--network dokploy-network \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
--mount type=bind,source=/etc/dokploy,target=/etc/dokploy \
--mount type=volume,source=dokploy-docker-config,target=/root/.docker \
--publish published=3000,target=3000,mode=host \
--update-parallelism 1 \
--update-order stop-first \
--constraint 'node.role == manager' \
-e ADVERTISE_ADDR=$advertise_addr \
dokploy/dokploy:latest

sleep 4

docker run -d \
--name dokploy-traefik \
--network dokploy-network \
--restart always \
-v /etc/dokploy/traefik/traefik.yml:/etc/traefik/traefik.yml \
-v /etc/dokploy/traefik/dynamic:/etc/dokploy/traefik/dynamic \
-v /var/run/docker.sock:/var/run/docker.sock \
-p 80:80/tcp \
-p 443:443/tcp \
-p 443:443/udp \
traefik:v3.1.2


# Optional: Use docker service create instead of docker run
# docker service create \
# --name dokploy-traefik \
# --constraint 'node.role==manager' \
# --network dokploy-network \
# --mount type=bind,source=/etc/dokploy/traefik/traefik.yml,target=/etc/traefik/traefik.yml \
# --mount type=bind,source=/etc/dokploy/traefik/dynamic,target=/etc/dokploy/traefik/dynamic \
# --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
# --publish mode=host,published=443,target=443 \
# --publish mode=host,published=80,target=80 \
# --publish mode=host,published=443,target=443,protocol=udp \
# traefik:v3.1.2
curl -sSL https://dokploy.com/install-compose.yml -o /etc/dokploy/docker-compose.yml

echo "Docker Compose file downloaded"

docker compose up -d --remove-orphans -p dokploy -f /etc/dokploy/docker-compose.yml

GREEN="\033[0;32m"
YELLOW="\033[1;33m"
Expand Down Expand Up @@ -206,8 +152,11 @@ update_dokploy() {
# Pull the latest image
docker pull dokploy/dokploy:latest

# Update the service
docker service update --image dokploy/dokploy:latest dokploy
# Pull new docker-compose file and restart the service
curl -sSL https://dokploy.com/install-compose.yml -o /etc/dokploy/docker-compose.yml

docker compose down -p dokploy -f /etc/dokploy/docker-compose.yml
docker compose up -d --remove-orphans -p dokploy -f /etc/dokploy/docker-compose.yml

echo "Dokploy has been updated to the latest version."
}
Expand Down