Skip to content

Instantly share code, notes, and snippets.

@mewm
Created February 22, 2017 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mewm/15e62c27fcfac1d5bacdac2846c01497 to your computer and use it in GitHub Desktop.
Save mewm/15e62c27fcfac1d5bacdac2846c01497 to your computer and use it in GitHub Desktop.
Sane bootstrap project
COMPOSE_PROJECT_NAME=que
APP_DOMAIN=que.dev:1337
APP_ENV=local
APP_DEBUG=true
APP_KEY=base64:bL0u0tMo8TFA8yIrBKAbMfONQ/uIZSqNcN4PlXniYTc=
DB_HOST=mariadb
DB_DATABASE=que
DB_USERNAME=que
DB_PASSWORD=que
version: '2'
services:
appsource:
image: busybox
volumes:
- ./:/var/www/site
nginx:
image: nginx:mainline-alpine
volumes:
- ./docker/nginx.conf:/etc/nginx/nginx.conf
volumes_from:
- appsource
ports:
- 1337:80
links:
- phpfpm
# Database
mariadb:
image: mariadb:latest
environment:
MYSQL_ROOT_PASSWORD: que
MYSQL_DATABASE: que
MYSQL_USER: que
MYSQL_PASSWORD: que
ports:
- 3306:3306
phpfpm:
volumes_from:
- appsource
build:
context: docker/php
image: mewm/que:latest
links:
- mariadb
env_file:
- .env.docker
working_dir: /var/www/site
user nginx;
worker_processes auto;
pid /var/run/nginx.pid;
events {
worker_connections 10000;
}
http {
sendfile off;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log warn;
server {
listen 80;
root /var/www/site/public;
index index.php index.htm index.html;
client_max_body_size 100m;
add_header x-content-type-options nosniff;
location ~ \.php$ {
try_files $uri /index.php?$query_string;
include fastcgi_params;
fastcgi_connect_timeout 30s;
fastcgi_read_timeout 30s;
fastcgi_buffers 256 4k;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass phpfpm:9000;
}
location / {
autoindex off;
try_files $uri $uri/ /index.php?$query_string;
}
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|svg|woff|woff2|ttf)\$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}
location ~* \.(?:css|js)\$ {
expires 7d;
access_log off;
add_header Cache-Control "public";
}
location ~ /\.ht {
deny all;
}
}
}
FROM php:7-fpm-alpine
LABEL maintainer "root@mewm.org"
RUN apk upgrade --update
RUN docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) pdo_mysql
#openssl mbstring tokenizer xml
ADD ./php.ini /usr/local/etc/php/conf.d/php.ini
upload_max_filesize = 64M
memory_limit = 256M
opcache.enable=1
opcache.enable_cli=0
# Check for changes every time
opcache.revalidate_freq=0
#opcache.validate_timestamps - use 1 for dev environment
opcache.validate_timestamps=1
opcache.max_accelerated_files=10000
opcache.memory_consumption=192
opcache.interned_strings_buffer=16
opcache.fast_shutdown=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment