Public Repository

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description

#Lamp Stack

##Fleetctl - Unit files

  • lamp@.service unit file
[Unit]
Description=LAMP Stack
After=etcd.service
After=docker.service
Requires=lamp-discovery@%i.service

[Service]
TimeoutStartSec=0
KillMode=none
EnvironmentFile=/etc/environment
ExecStartPre=-/usr/bin/docker kill lamp%i
ExecStartPre=-/usr/bin/docker rm lamp%i
ExecStartPre=/usr/bin/docker pull hutchgrant/lampstack
ExecStart=/usr/bin/docker run --name lamp%i -p ${COREOS_PUBLIC_IPV4}:%i:80 -p ${COREOS_PUBLIC_IPV4}:3306:3306 hutchgrant/lampstack /usr/sbin/apache2ctl -D FOREGROUND
ExecStop=/usr/bin/docker stop lamp%i

[X-Fleet]
X-Conflicts=lamp@*.service
  • lamp-discovery@.service unit file
[Unit]
Description=Announce lamp@%i service
BindsTo=lamp@%i.service

[Service]
EnvironmentFile=/etc/environment
ExecStart=/bin/sh -c "while true; do etcdctl set /announce/services/lamp%i ${COREOS_PUBLIC_IPV4}:%i --ttl 60; sleep 45; done"
ExecStop=/usr/bin/etcdctl rm /announce/services/lamp%i

[X-Fleet]
X-ConditionMachineOf=lamp@%i.service

Start services

fleetctl submit lamp@.service lamp-discovery@.service
fleetctl load lamp@80.service
fleetctl load lamp-discovery@80.service
fleetctl start lamp@80.service

Note: 80 can be any port you want to forward it to.

###Daemon Run apache on a specific port

docker run --name checkoutcryptosite -p ${COREOS_PUBLIC_IPV4}:80:80 checkoutcrypto/site /usr/sbin/apache2ctl -D FOREGROUND

Then simply access it from the container's public IP with port 80. Change :80:80 e.g. hostport:containerport

###Single run, login with bash:

docker run -it hutchgrant/lampstack /bin/bash

Site files located at /var/www/html -

Included:

apache2 mysql-server php5 libapache2-mod-php5 tasksel php5-curl phpmyadmin curl

Docker Pull Command
Owner
hutchgrant