Skip to content

Instantly share code, notes, and snippets.

@kawaii
Created February 5, 2020 17:21
Show Gist options
  • Save kawaii/2ca31427125ea065b4e2fa14eb199f30 to your computer and use it in GitHub Desktop.
Save kawaii/2ca31427125ea065b4e2fa14eb199f30 to your computer and use it in GitHub Desktop.
version: '3.7'
services:
mybb:
image: mybb/mybb:1.8.22
environment:
restart: on-failure
volumes:
- ${PWD}/mybb:/var/www/html
nginx:
image: nginx:mainline-alpine
ports:
- 80:80/tcp
restart: on-failure
volumes:
- ${PWD}/nginx:/etc/nginx/conf.d:ro
- ${PWD}/mybb:/var/www/html:rw
postgresql:
image: postgres:12.1-alpine
environment:
POSTGRES_DB: mybb
POSTGRES_USER: mybb
POSTGRES_PASSWORD: changeme
healthcheck:
test: ["CMD-SHELL", "pg_isready -U mybb"]
interval: 30s
timeout: 30s
retries: 3
restart: on-failure
volumes:
- ${PWD}/postgres/data:/var/lib/postgresql/data
upstream mybb {
server mybb:9000 weight=5;
}
server {
listen 80;
root /var/www/html;
index index.html index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ inc/ {
internal;
}
location ~ ^/(images|cache|jscripts|uploads)/ {
access_log off;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass mybb;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment