mirror of https://github.com/flarum/flarum
Added docker-compose, dockerfile for custom fpm and nginx config
parent
03223e3c69
commit
68653be47b
|
@ -0,0 +1,48 @@
|
||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
image: nginx:alpine
|
||||||
|
volumes:
|
||||||
|
- ./:/var/www
|
||||||
|
- ./nginx/flarum.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
- ./.nginx.conf:/etc/nginx/conf.d/.nginx.conf
|
||||||
|
ports:
|
||||||
|
- 8080:80
|
||||||
|
networks:
|
||||||
|
- code-network
|
||||||
|
depends_on:
|
||||||
|
- php
|
||||||
|
|
||||||
|
php:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: flarum-fpm.dockerfile
|
||||||
|
image: flarum-fpm:1
|
||||||
|
volumes:
|
||||||
|
- ./:/var/www
|
||||||
|
networks:
|
||||||
|
- code-network
|
||||||
|
- db-network
|
||||||
|
depends_on:
|
||||||
|
- mariadb
|
||||||
|
|
||||||
|
mariadb:
|
||||||
|
image: mariadb:10.4
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD=rootpass
|
||||||
|
- MYSQL_DATABASE=flarum
|
||||||
|
- MYSQL_USER=flarum
|
||||||
|
- MYSQL_PASSWORD=flarumpass
|
||||||
|
volumes:
|
||||||
|
- db:/var/lib/mysql
|
||||||
|
networks:
|
||||||
|
- db-network
|
||||||
|
|
||||||
|
networks:
|
||||||
|
code-network:
|
||||||
|
driver: bridge
|
||||||
|
db-network:
|
||||||
|
driver: bridge
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
db:
|
|
@ -0,0 +1,4 @@
|
||||||
|
FROM php:7.2-fpm-alpine
|
||||||
|
RUN apk add libjpeg-turbo-dev libpng-dev freetype-dev
|
||||||
|
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
|
||||||
|
&& docker-php-ext-install -j$(nproc) gd pdo_mysql
|
|
@ -0,0 +1,21 @@
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
index index.php index.html;
|
||||||
|
server_name localhost;
|
||||||
|
error_log /var/log/nginx/error.log;
|
||||||
|
access_log /var/log/nginx/access.log;
|
||||||
|
root /var/www/public;
|
||||||
|
|
||||||
|
location ~ \.php$ {
|
||||||
|
try_files $uri =404;
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
fastcgi_pass php:9000;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
include /etc/nginx/conf.d/.nginx.conf;
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue