Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- services:
- nginx:
- build: ./nginx/
- ports:
- - 443:443
- volumes:
- - ${APPLICATION_ROOT}:/${WEBROOT}
- - ./ssl:/etc/nginx/ssl
- - ./nginx/config/default.conf:/etc/nginx/conf.d/default.conf
- restart: always
- depends_on:
- - php
- environment:
- ENVIRONMENT: "${APPLICATION_ENV}"
- URL: "${APPLICATION_URL}"
- container_name: nginx
- php:
- build: ./php/
- ports:
- - 8080:80
- volumes:
- - ${APPLICATION_ROOT}:/${WEBROOT}
- restart: always
- depends_on:
- - mysql
- environment:
- ENVIRONMENT: "${APPLICATION_ENV}"
- URL: "${APPLICATION_URL}"
- MYSQL_HOST: "${DB_HOST}"
- MYSQL_DATABASE: "${DB_NAME}"
- MYSQL_USER: "${DB_USERNAME}"
- MYSQL_PASSWORD: "${DB_PASSWORD}"
- container_name: php
- FROM nginx:latest
- # Update package libraries
- RUN apt-get update -y &&
- apt-get install -y
- nano
- curl
- wget
- unzip
- libmcrypt-dev
- server {
- listen 80;
- index index.php index.html;
- server_name $URL_from_env;
- return 301 https://$host$request_uri;
- }
- server{
- listen 443 ssl http2;
- index index.php index.html;
- server_name $URL_from_env;
- error_log /var/log/nginx/error.log;
- access_log /var/log/nginx/access.log;
- root /var/www/html/public;
- # set max upload
- client_max_body_size 500M;
- ssl on;
- ssl_certificate /etc/nginx/ssl/cert.pem;
- ssl_certificate_key /etc/nginx/ssl/cert.key;
- # use fastcgi for all php files
- location ~ .php$ {
- try_files $uri =404;
- fastcgi_split_path_info ^(.+.php)(/.+)$;
- fastcgi_pass php:9000;
- fastcgi_index index.php;
- # include fastcgi parameters
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_param PATH_INFO $fastcgi_path_info;
- }
- # rewrite url's & parse through index
- location / {
- try_files $uri $uri/ /hub/index.php?$args;
- # set max upload
- client_max_body_size 500M;
- }
- }
Add Comment
Please, Sign In to add comment