├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── docker-compose.yml ├── lucee ├── lucee-server.xml └── lucee-web.xml.cfm ├── scripts └── entrypoint.sh └── www ├── index.cfm └── installhelper ├── mura.cfm └── slatwall.cfm /.gitignore: -------------------------------------------------------------------------------- 1 | *.project 2 | *.settings 3 | *.DS_Store 4 | *.zip 5 | *.lic 6 | *.pfx 7 | _notes/ 8 | aspnet_client/ 9 | settings.xml 10 | ehthumbs.db 11 | thumbs.db 12 | settings.xml/ 13 | logs/ 14 | WEB-INF 15 | .rdsTempFiles/ 16 | 17 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM lucee/lucee:4.5.3-t8.0.36 2 | MAINTAINER Greg Moser, greg.moser@ten24web.com 3 | 4 | RUN apt-get update && apt-get install -y uuid-runtime 5 | 6 | # Copy over the Lucee Config Files 7 | COPY lucee/lucee-server.xml /opt/lucee/server/lucee-server/context/lucee-server.xml 8 | COPY lucee/lucee-web.xml.cfm /opt/lucee/web/lucee-web.xml.cfm 9 | 10 | # Expose Ports 11 | EXPOSE 8080 12 | 13 | # Copy the projects www contents over 14 | COPY www /var/www 15 | 16 | COPY scripts/entrypoint.sh /entrypoint.sh 17 | ENTRYPOINT ["/entrypoint.sh"] 18 | 19 | CMD ["catalina.sh", "run"] 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Greg Moser 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker Lucee MySQL 2 | This is a starter template git repo for running a Database dirven applications on Docker with Lucee & MySQL. It is designed to be copied and used as a git repo for your next web application project. 3 | 4 | If you plan to use an open source CFML application (Mura, Slatwall, etc.), this repo also has some code for installing those types of applications automatically on first run. We welcome any other open source applications to be added to this repo as well. 5 | 6 | Not only will this simplify team development, but it will also allow you to run your application in the cloud using tutum by docker for test, staging & production enviornments. 7 | 8 | # Key Features 9 | 10 | - Run your application with no install of Lucee or MySQL 11 | - Consistent development enviornment for all team members 12 | - Take DB snapshots during development, and pass around to other team members with the codebase (via git) 13 | - Push application to cloud using Tutum / Cloud Provider (AWS, DigitalOcean, Google, etc.) 14 | - Configure your development enviornments via repo 15 | - Configure your production enviornments via repo 16 | 17 | 18 | # Requirements 19 | 20 | - git 21 | - docker toolbox (with docker-compose version >= 1.6) 22 | 23 | 24 | # Quickstart 25 | 26 | To get up and running simply navigate to where you want to run your project and do: 27 | 28 | ``` 29 | git clone https://github.com/gregmoser/docker-lucee-mysql.git myProjectName 30 | ``` 31 | 32 | Then open up the docker quickstart terminal that was installed with docker toolbox, and make a note of the IP address it is running on. 33 | 34 | Navigate to the new project directory 35 | 36 | ``` 37 | cd myProjectName 38 | ``` 39 | 40 | run the following command to start your project 41 | 42 | ``` 43 | docker-compose up 44 | ``` 45 | 46 | Thats It! Navigate to the IP address of the docker machine you're running (that you noted above when starting the terminal). You can also open kitematic to see the web app running, and click on the web preview link 47 | 48 | 49 | # Important Next Steps 50 | 51 | Now that you've got the application up and running it's important to take a few next steps so that the repo works for YOUR project. 52 | 53 | Open the git config 54 | ``` 55 | /myProjectName/.git/config 56 | ``` 57 | 58 | It should look something like this: 59 | ``` 60 | [core] 61 | symlinks = false 62 | repositoryformatversion = 0 63 | filemode = true 64 | logallrefupdates = true 65 | precomposeunicode = true 66 | [remote "origin"] 67 | url = https://github.com/gregmoser/docker-lucee-mysql.git 68 | fetch = +refs/heads/*:refs/remotes/origin/* 69 | [branch "master"] 70 | remote = origin 71 | merge = refs/heads/master 72 | ``` 73 | 74 | You want to change the url under origin to be something like 75 | ``` 76 | [remote "origin"] 77 | url = https://github.com/MY_GITHUB_USERNAME/MY_PROJECT_NAME.git 78 | fetch = +refs/heads/*:refs/remotes/origin/* 79 | ``` 80 | 81 | From that point forward all of your team members will just pull from this new git repo that you have setup. They will be starting from the point that you left off. All of your projects code lives in the /www folder so you and your co-workers can work, commit, push & pull as needed. 82 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | web: 4 | build: . 5 | ports: 6 | - "80:8080" 7 | volumes: 8 | - ./www:/var/www 9 | links: 10 | - appdb 11 | environment: 12 | LUCEE_PASSWORD: MakeThisSecretLuceeAdminPassword! 13 | MYSQL_ROOT_PASSWORD : MakeThisSecretMySQLRootPassword! 14 | MYSQL_HOST : appdb 15 | MYSQL_DATABASE : appdatabase 16 | appdb: 17 | image: mysql 18 | ports: 19 | - "3306:3306" 20 | volumes: 21 | - /var/lib/mysql 22 | environment: 23 | MYSQL_ROOT_PASSWORD : MakeThisSecretMySQLRootPassword! 24 | MYSQL_DATABASE : appdatabase -------------------------------------------------------------------------------- /lucee/lucee-server.xml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 47 | 48 | 49 | 50 | 51 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 73 | 74 | 75 | 89 | 90 | 91 | 98 | 99 | 104 | 105 | 110 | 111 | 116 | 117 | 122 | 123 | 128 | 129 | 130 | 142 | 143 | 144 | 145 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 216 | 217 | 218 | 219 | 220 | 231 | 232 | 233 | 245 | 246 | 247 | 250 | 251 | 252 | 267 | 268 | 269 | 270 | 283 | 284 | 285 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | -------------------------------------------------------------------------------- /lucee/lucee-web.xml.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 52 | 53 | 54 | 55 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 83 | 84 | 85 | 89 | 90 | 91 | 92 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 134 | 135 | 136 | 137 | 148 | 149 | 150 | 153 | 154 | 155 | 156 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | -------------------------------------------------------------------------------- /scripts/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | ##### GENERATE CORRECT LUCEE PASSWORD HASH ##### 5 | LUCEEPASS=${LUCEE_PASSWORD} 6 | 7 | #LUCEESERVERSALT=$(uuidgen) 8 | #LUCEESERVERSALT=${LUCEESERVERSALT^^} 9 | LUCEESERVERSALT='4FDA588E-318A-445C-898736AA1F229A69' 10 | 11 | #LUCEEWEBSALT=$(uuidgen) 12 | #LUCEEWEBSALT=${LUCEEWEBSALT^^} 13 | LUCEEWEBSALT='12FB74C3-69CD-4348-A839A29127ED8B7C' 14 | 15 | LUCEESERVERPASS=$LUCEEPASS:$LUCEESERVERSALT 16 | LUCEEWEBPASS=$LUCEEPASS:$LUCEEWEBSALT 17 | 18 | for i in `seq 1 5`; 19 | do 20 | LUCEESERVERPASS=($(echo -n $LUCEESERVERPASS | sha256sum)) 21 | LUCEEWEBPASS=($(echo -n $LUCEEWEBPASS | sha256sum)) 22 | done 23 | 24 | ##### UPDATE LUCEE CONFIG FILES ##### 25 | # Update Lucee Server Admin Password 26 | sed -i "s/\${SERVER-HSPW}/$LUCEESERVERPASS/g" /opt/lucee/server/lucee-server/context/lucee-server.xml 27 | sed -i "s/\${SERVER-HSPW-SALT}/$LUCEESERVERSALT/g" /opt/lucee/server/lucee-server/context/lucee-server.xml 28 | 29 | # Update Lucee Datasource Information 30 | sed -i "s/\${MYSQL_ROOT_PASSWORD}/${MYSQL_ROOT_PASSWORD}/g" /opt/lucee/server/lucee-server/context/lucee-server.xml 31 | sed -i "s/\${MYSQL_HOST}/${MYSQL_HOST}/g" /opt/lucee/server/lucee-server/context/lucee-server.xml 32 | sed -i "s/\${MYSQL_DATABASE}/${MYSQL_DATABASE}/g" /opt/lucee/server/lucee-server/context/lucee-server.xml 33 | 34 | # Update Lucee Web Admin Password 35 | sed -i "s/\${WEB-HSPW}/$LUCEEWEBPASS/g" /opt/lucee/web/lucee-web.xml.cfm 36 | sed -i "s/\${WEB-HSPW-SALT}/$LUCEEWEBSALT/g" /opt/lucee/web/lucee-web.xml.cfm 37 | 38 | 39 | exec "$@" -------------------------------------------------------------------------------- /www/index.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Lucee Project Setup 25 | 26 | 27 |

28 | If you are seeing this screen it is because you are running the lucee project for the first time and have not defined a "BASE_APP_INSTALL" enviornment variable. 29 |

30 |

31 | Don't WORRY! You can install an application right here from this screen administrator. When the application is installed it will remove this helper app. 32 |

36 |

37 |

38 | If you would just like to code up your own custom app, go ahead and delete the files in the www directory and get started! 39 |

40 |

41 | TODO: Make this page more informative and better looking :) 42 |

43 | 44 |
45 |
-------------------------------------------------------------------------------- /www/installhelper/mura.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | Mura has been installed click here to launch 22 |
23 |
24 |

IMPORTANT: The datasource name for you mura setup is: '#env.MYSQL_DATABASE#'

25 |

IMPORTANT: The database type for your mura setup is: MySQL

26 |

IMPORTANT: The database username & password should be left blank

27 |
-------------------------------------------------------------------------------- /www/installhelper/slatwall.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Slatwall has been installed click here to launch --------------------------------------------------------------------------------