Skip to content

Commit 26a8f98

Browse files
committed
Use Procfile to start all dokku-alt dependencies
1 parent ad581d7 commit 26a8f98

3 files changed

Lines changed: 35 additions & 1 deletion

File tree

‎Dockerfile‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D78692
2121
apt-get update && \
2222
apt-get install -y lxc-docker
2323

24+
# Install forego
25+
RUN curl -o /usr/bin/forego https://godist.herokuapp.com/projects/ddollar/forego/releases/current/linux-amd64/forego && chmod +x /usr/bin/forego
26+
2427
# Configure ssh daemon
2528
RUN sed -i 's/^PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config
2629

@@ -37,4 +40,4 @@ RUN make install
3740
EXPOSE 22 80 443
3841

3942
# Start all services
40-
CMD ["/srv/dokku-alt/start-services.sh"]
43+
CMD ["forego", "start"]

‎Procfile‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
nginx: exec nginx -g "daemon off; error_log /dev/stdout info;"
2+
ssh: mkdir /var/run/sshd; exec /usr/sbin/sshd -De
3+
dokku: exec /srv/dokku-alt/start-dokku.sh
4+
docker: exec docker -d

‎start-dokku.sh‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
export HOME=/root
4+
5+
for i in $(seq 1 1000)
6+
do
7+
if docker ps 1>/dev/null 2>/dev/null; then
8+
break
9+
fi
10+
11+
echo "Waiting for docker ($i)..."
12+
sleep 3s
13+
done
14+
15+
echo "Configuring dokku..."
16+
sshcommand create dokku /usr/local/bin/dokku
17+
dokku plugins-install
18+
PASSWORD=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c16)
19+
20+
echo "root:$PASSWORD" | chpasswd
21+
22+
echo "SSH Login:"
23+
echo " user: root"
24+
echo " password: $PASSWORD"
25+
echo " ip: $(hostname -I)"
26+
27+
exec dokku-daemon

0 commit comments

Comments
 (0)