Complete docker-compose.yml example? #5522
-
I can't find any tutorial with docker-compose.yml anywhere, do you know any? There is literally nothing on Google and YouTube. Article in docs is very short and incomplete, e.g. one of the things that annoys me is that it says to enter the container and generate ssh keys, which makes no sense because they will disappear as soon as I restart the container. Or just generate keys and add them via cat ~/.ssh/authorized_keys | dokku ssh-keys:add admin https://dokku.com/docs/getting-started/install/docker/ Do you know any tutorial or example how to setup Dokku with docker-compose.yml from start to finish? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Currently exploring same issue. I'm converting from Centos over to RHEL, so need to use the docker installation method. And yes, with the provided example for "docker container run", the home directory for dokku (/home/dokku) is not persistent, so upon container restart, you'll lose your ssh keys for the dokku user |
Beta Was this translation helpful? Give feedback.
-
I ran the following modified command based on the docker install docs in conjunction with
docker-run-export run --dre-project dokku \
--env DOKKU_HOSTNAME=dokku.me \
--env DOKKU_HOST_ROOT=/var/lib/dokku/home/dokku \
--name dokku \
--publish 3022:22 \
--publish 8080:80 \
--publish 8443:443 \
--volume /var/lib/dokku:/mnt/dokku \
--volume /var/run/docker.sock:/var/run/docker.sock \
dokku/dokku:0.29.0 This is what it spit out: ---
name: dokku
services:
app:
container_name: dokku
environment:
DOKKU_HOST_ROOT: /var/lib/dokku/home/dokku
DOKKU_HOSTNAME: dokku.me
image: dokku/dokku:0.29.0
ports:
- mode: ingress
target: 22
published: "3022"
protocol: tcp
- mode: ingress
target: 80
published: "8080"
protocol: tcp
- mode: ingress
target: 443
published: "8443"
protocol: tcp
volumes:
- type: bind
source: /var/lib/dokku
target: /mnt/dokku
- type: bind
source: /var/run/docker.sock
target: /var/run/docker.sock I don't provide more instructions than the docker run command on purpose because everyone's setup is different. One person's docker compose setup is not the same as the next, and folks might want kubernetes or ecs or nomad or whatever setups next. The |
Beta Was this translation helpful? Give feedback.
I ran the following modified command based on the docker install docs in conjunction with
dokku/docker-run-export
to generate a compose file. The only changes I made were:docker-run-export
container
as part of the subcommand--dre-project dokku
flagThis is what it spit out: