-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad408d9
commit e4ab853
Showing
3 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
user nginx; | ||
worker_processes auto; | ||
|
||
error_log /var/log/nginx/error.log notice; | ||
pid /var/run/nginx.pid; | ||
|
||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /var/log/nginx/access.log main; | ||
|
||
sendfile on; | ||
#tcp_nopush on; | ||
|
||
keepalive_timeout 65; | ||
|
||
#gzip on; | ||
|
||
upstream dolibarr { | ||
server dolibarr:9000; | ||
} | ||
|
||
server { | ||
listen 80; | ||
keepalive_timeout 70; | ||
|
||
root /var/www/html/; | ||
index index.php; | ||
|
||
try_files $uri $uri/ =404; | ||
|
||
location ~ [^/]\.php(/|$) { | ||
fastcgi_split_path_info ^(.+?\.php)(/.*)$; | ||
|
||
# Mitigate https://httpoxy.org/ vulnerabilities | ||
fastcgi_param HTTP_PROXY ""; | ||
|
||
fastcgi_pass dolibarr; | ||
fastcgi_index index.php; | ||
|
||
include fastcgi_params; | ||
|
||
fastcgi_intercept_errors on; | ||
fastcgi_param SCRIPT_FILENAME $request_filename; | ||
|
||
# Dolibarr Rest API path support | ||
fastcgi_param PATH_INFO $fastcgi_path_info; | ||
fastcgi_param PATH_TRANSLATED $request_filename; | ||
fastcgi_param CONTEXT_DOCUMENT_ROOT $document_root; | ||
} | ||
|
||
client_max_body_size 8m; | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
networks: | ||
internal-pod: | ||
internal: true | ||
external-pod: | ||
internal: false | ||
|
||
volumes: | ||
dolibarr-htdocs: | ||
dolibarr-custom: | ||
dolibarr-docs: | ||
mysql-data: | ||
|
||
services: | ||
nginx: | ||
image: nginx | ||
ports: | ||
- 80:80 | ||
volumes: | ||
- ./conf/nginx.conf:/etc/nginx/nginx.conf:ro | ||
- dolibarr-htdocs:/var/www/html:ro | ||
- dolibarr-custom:/var/www/html/custom:ro | ||
networks: | ||
- internal-pod | ||
- external-pod | ||
|
||
dolibarr: | ||
image: dolibarr/dolibarr:latest-fpm | ||
environment: | ||
DOLI_DB_HOST: "mysql" | ||
DOLI_DB_HOST_PORT: "3306" | ||
DOLI_DB_USER: "dolibarr" | ||
DOLI_DB_PASSWORD: "mysupersecretpasswordfordatabase" | ||
DOLI_DB_NAME: "dolibarr" | ||
DOLI_ADMIN_LOGIN: "admin" | ||
DOLI_ADMIN_PASSWORD: "mysuperhypersecretpasswordforadminacount" | ||
volumes: | ||
- dolibarr-docs:/var/www/documents | ||
- dolibarr-htdocs:/var/www/html | ||
- dolibarr-custom:/var/www/html/custom | ||
networks: | ||
- internal-pod | ||
|
||
mysql: | ||
image: mysql:latest | ||
environment: | ||
MYSQL_DATABASE: "dolibarr" | ||
MYSQL_USER: "dolibarr" | ||
MYSQL_PASSWORD: "mysupersecretpasswordfordatabase" | ||
MYSQL_ROOT_PASSWORD: "mysupersupersecretpasswordforrootuser" | ||
volumes: | ||
- mysql-data:/var/lib/mysql | ||
networks: | ||
- internal-pod |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Dolibarr with FPM and Nginx | ||
|
||
This example use the PHP-FPM image with Nginx instead of Apache2. |