bunkerweb 1.4.0
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
# Autoconf PHP
|
||||
|
||||
Quickly deploy PHP app on Docker containers without restarting bunkerized-nginx.
|
||||
|
||||
## Architecture
|
||||
|
||||
<img src="https://github.com/bunkerity/bunkerized-nginx/blob/master/examples/autoconf-php/architecture.png?raw=true" />
|
||||
|
||||
## Autoconf
|
||||
|
||||
First of all, you need to setup the [Docker autoconf integration](https://bunkerized-nginx.readthedocs.io/en/latest/integrations.html#docker-autoconf).
|
||||
|
||||
Then, you can add and remove PHP apps with special `bunkerized-nginx.*` labels so the configurations are automatically generated : see [docker-compose.yml](https://github.com/bunkerity/bunkerized-nginx/blob/master/examples/autoconf-php/docker-compose.yml).
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
echo "Hello from app1 !";
|
||||
|
||||
?>
|
||||
|
||||
<script src="/js/script.js"></script>
|
||||
@@ -0,0 +1 @@
|
||||
alert('JavaScript is working!');
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
echo "Hello from app2 !";
|
||||
|
||||
?>
|
||||
|
||||
<script src="/js/script.js"></script>
|
||||
@@ -0,0 +1 @@
|
||||
alert('JavaScript is working!');
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
echo "Hello from app3 !";
|
||||
|
||||
?>
|
||||
|
||||
<script src="/js/script.js"></script>
|
||||
@@ -0,0 +1 @@
|
||||
alert('JavaScript is working!');
|
||||
@@ -5,43 +5,55 @@ services:
|
||||
myapp1:
|
||||
image: php:fpm
|
||||
networks:
|
||||
services-net:
|
||||
bw-services:
|
||||
aliases:
|
||||
- myapp1
|
||||
# ⚠️ UID and GID of mywww (101:101) and php:fpm (33:33) are not the same ⚠️
|
||||
# but both needs access to the files and folders of web-files
|
||||
# don't forget to edit the permissions of the files and folders accordingly
|
||||
# example : chown -R 33:101 ./bw-data/www && find ./bw-data/www -type f -exec chmod 0640 {} \; && find ./bw-data/www -type d -exec chmod 0750 {} \;
|
||||
volumes:
|
||||
- ./web-files/app1.example.com:/app
|
||||
- ./bw-data/www/app1.example.com:/app # folder containing PHP app1 (don't forget to rename it)
|
||||
labels:
|
||||
- "bunkerized-nginx.SERVER_NAME=app1.example.com" # replace with your domain
|
||||
- "bunkerized-nginx.REMOTE_PHP=myapp1"
|
||||
- "bunkerized-nginx.REMOTE_PHP_PATH=/app"
|
||||
- "bunkerweb.SERVER_NAME=app1.example.com" # replace with your domain
|
||||
- "bunkerweb.REMOTE_PHP=myapp1"
|
||||
- "bunkerweb.REMOTE_PHP_PATH=/app"
|
||||
|
||||
myapp2:
|
||||
image: php:fpm
|
||||
networks:
|
||||
services-net:
|
||||
bw-services:
|
||||
aliases:
|
||||
- myapp2
|
||||
# ⚠️ UID and GID of mywww (101:101) and php:fpm (33:33) are not the same ⚠️
|
||||
# but both needs access to the files and folders of web-files
|
||||
# don't forget to edit the permissions of the files and folders accordingly
|
||||
# example : chown -R 33:101 ./bw-data/www && find ./bw-data/www -type f -exec chmod 0640 {} \; && find ./bw-data/www -type d -exec chmod 0750 {} \;
|
||||
volumes:
|
||||
- ./web-files/app2.example.com:/app
|
||||
- ./bw-data/www/app2.example.com:/app # folder containing PHP app2 (don't forget to rename it)
|
||||
labels:
|
||||
- "bunkerized-nginx.SERVER_NAME=app2.example.com" # replace with your domain
|
||||
- "bunkerized-nginx.REMOTE_PHP=myapp2"
|
||||
- "bunkerized-nginx.REMOTE_PHP_PATH=/app"
|
||||
- "bunkerweb.SERVER_NAME=app2.example.com" # replace with your domain
|
||||
- "bunkerweb.REMOTE_PHP=myapp2"
|
||||
- "bunkerweb.REMOTE_PHP_PATH=/app"
|
||||
|
||||
myapp3:
|
||||
image: php:fpm
|
||||
networks:
|
||||
services-net:
|
||||
bw-services:
|
||||
aliases:
|
||||
- myapp3
|
||||
# ⚠️ UID and GID of mywww (101:101) and php:fpm (33:33) are not the same ⚠️
|
||||
# but both needs access to the files and folders of web-files
|
||||
# don't forget to edit the permissions of the files and folders accordingly
|
||||
# example : chown -R 33:101 ./bw-data/www && find ./bw-data/www -type f -exec chmod 0640 {} \; && find ./bw-data/www -type d -exec chmod 0750 {} \;
|
||||
volumes:
|
||||
- ./web-files/app3.example.com:/app
|
||||
- ./bw-data/www/app3.example.com:/app # folder containing PHP app3 (don't forget to rename it)
|
||||
labels:
|
||||
- "bunkerized-nginx.SERVER_NAME=app3.example.com" # replace with your domain
|
||||
- "bunkerized-nginx.REMOTE_PHP=myapp3"
|
||||
- "bunkerized-nginx.REMOTE_PHP_PATH=/app"
|
||||
- "bunkerweb.SERVER_NAME=app3.example.com" # replace with your domain
|
||||
- "bunkerweb.REMOTE_PHP=myapp3"
|
||||
- "bunkerweb.REMOTE_PHP_PATH=/app"
|
||||
|
||||
networks:
|
||||
services-net:
|
||||
bw-services:
|
||||
external:
|
||||
name: services-net
|
||||
name: bw-services
|
||||
|
||||
13
examples/autoconf-php/setup.sh
Executable file
13
examples/autoconf-php/setup.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $(id -u) -ne 0 ] ; then
|
||||
echo "❌ Run me as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
chown -R 101:101 bw-data
|
||||
find ./bw-data/ -type f -exec chmod 0644 {} \;
|
||||
find ./bw-data/ -type d -exec chmod 0755 {} \;
|
||||
chown -R 101:33 ./bw-data/www
|
||||
find ./bw-data/www -type f -exec chmod 0664 {} \;
|
||||
find ./bw-data/www -type d -exec chmod 0775 {} \;
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
|
||||
echo "Hello from app1 !";
|
||||
|
||||
?>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
|
||||
echo "Hello from app2 !";
|
||||
|
||||
?>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
|
||||
echo "Hello from app3 !";
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user