Last active
August 10, 2017 13:15
-
-
Save chrisdpeters/c6b420443e146b9592ea to your computer and use it in GitHub Desktop.
CFWheels, meet Docker http://blog.chrisdpeters.com/cfwheels-meet-docker/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfoutput> | |
<!--- Instead of a lame check like `<cfif get("environment") eq "production">`, | |
we can instead do whatever the environment is calling for ---> | |
<cfif | |
StructKeyExists(server.ENV, "GOOGLE_ANALYTICS_TRACKING_CODE") | |
and Len(server.ENV.GOOGLE_ANALYTICS_TRACKING_CODE) | |
> | |
<script> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
ga('create', '#server.ENV.GOOGLE_ANALYTICS_TRACKING_CODE#', 'example.com'); | |
ga('send', 'pageview'); | |
</script> | |
</cfif> | |
</cfoutput> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
// Setup environment variables. | |
server.ENV = CreateObject("java", "java.lang.System").getenv(); | |
// Setup data source. | |
this.DataSources["www"] = { | |
type=server.ENV.DB_TYPE, | |
host=server.ENV.DB_HOST, | |
port=server.ENV.DB_PORT, | |
database=server.ENV.DB_DATABASE, | |
username=server.ENV.DB_USERNAME, | |
password=server.ENV.DB_PASSWORD | |
}; | |
</cfscript> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker-compose build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: | |
build: . | |
command: ./start.sh | |
ports: | |
- "3000:80" | |
volumes: | |
- ./app/:/var/www/ | |
environment: | |
WHEELS_ENV: design | |
WHEELS_RELOAD_PW: | |
DB_TYPE: | |
DB_HOST: | |
DB_PORT: | |
DB_DATABASE: | |
DB_USERNAME: | |
DB_PASSWORD: | |
SMTP_SERVER: | |
SMTP_PORT: | |
SMTP_USESSL: | |
SMTP_USETLS: | |
SMTP_SIGN: | |
SMTP_USERNAME: | |
SMTP_PASSWORD: | |
SMTP_BCC: | |
SMTP_CHARSET: | |
SMTP_TIMEOUT: | |
SMTP_FAILTO: | |
SMTP_KEYSTORE: | |
SMTP_KEYSTOREPASSWORD: | |
SMTP_KEYALIAS: | |
SMTP_KEYPASSWORD: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ipconfig getifaddr en1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment