Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: '3'
- services:
- # Server API
- server-api:
- image: localhost/my-php-nginx
- container_name: api_container
- user: "0:0" # Menjalankan sebagai root:root internal
- userns_mode: "keep-id:uid=33,gid=33"
- ports:
- - "8101:80"
- volumes:
- - ./html:/var/www/html:Z
- - ./configs/def.conf:/etc/nginx/sites-enabled/default:ro # Hapus .conf
- - ./logs:/var/log/nginx # Folder Log (Read-Write)
- networks:
- - shared_net
- # configs:
- # - source: nginx_config
- # target: /etc/nginx/sites-enabled/default.conf
- # depends_on:
- # - database-maria-1
- # - database-maria-2
- # - database-postgres
- networks:
- shared_net:
- external: true
- name: shared_network
- configs:
- nginx_config:
- inline: |
- server {
- listen 80;
- server_name localhost;
- root /var/www/html;
- access_log /var/log/nginx/access.log;
- error_log /var/log/nginx/error.log;
- charset utf-8;
- location / {
- index index.php index.html index.htm;
- try_files $uri $uri/ /index.php?$query_string;
- }
- location ~ \.php$ {
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_intercept_errors off;
- fastcgi_buffer_size 16k;
- fastcgi_buffers 4 16k;
- }
- location ~ /\.ht {
- deny all;
- }
- location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
- expires max;
- log_not_found off;
- access_log off;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment