Nginx Server Blocks configuration to run more than one Laravel 5.1 web-app off of a single Linux server
- PHP package: php5-fpm php5-mcrypt php5-mysql
- Laravel 5.1
- Nginx 1.8
| import React from "react"; | |
| import { render } from "react-dom"; | |
| const ParentComponent = React.createClass({ | |
| getDefaultProps: function() { | |
| console.log("ParentComponent - getDefaultProps"); | |
| }, | |
| getInitialState: function() { | |
| console.log("ParentComponent - getInitialState"); | |
| return { text: "" }; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This script will read your secret file and set each line as an env variable in your container.
I' assuming that you already has a entrypoint file in your Dockerfile. So now, you need to copy and paste the contents of set_env_secrets.sh to your entrypoint(you don't need the first line).
Now, you need to create a secret, the name could be whatever you like. I'm using the name of my application as a pattern for my secrets name. For this example, my secret name will be super-project and the content will be.
| // Future versions of Hyper may add additional config options, | |
| // which will not automatically be merged into this file. | |
| // See https://hyper.is#cfg for all currently supported options. | |
| module.exports = { | |
| config: { | |
| // Choose either "stable" for receiving highly polished, | |
| // or "canary" for less polished but more frequent updates | |
| updateChannel: 'stable', |
| image: docker:latest | |
| services: | |
| - docker:dind | |
| stages: | |
| - build | |
| - deploy | |
| variables: |
| image: docker:latest | |
| services: | |
| - docker:dind | |
| stages: | |
| - build | |
| - deploy | |
| variables: |
| apiVersion: extensions/v1beta1 | |
| kind: DaemonSet | |
| metadata: | |
| labels: | |
| name: logspout | |
| name: logspout | |
| namespace: default | |
| spec: | |
| selector: | |
| matchLabels: |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| void main() { | |
| runApp(_SwitchingThemeApp()); | |
| } | |
| /// Properties that help me keep track of the example being run. | |
| bool _useMaterial = false; | |
| class _SwitchingThemeApp extends StatefulWidget { | |
| @override | |
| _SwitchingThemeAppState createState() => _SwitchingThemeAppState(); |